summaryrefslogtreecommitdiffstats
path: root/config-db
diff options
context:
space:
mode:
authorOliver Tappe2008-08-20 15:22:49 +0200
committerOliver Tappe2008-08-20 15:22:49 +0200
commita078b11b1afb308e2976300f32a9f3f70d4862f3 (patch)
tree60eb7af2d39dd66ba108a39a9a17e962c1a9fec1 /config-db
parent* merged branch 'initramfs-ng' back intro trunk - requires careful testing ... (diff)
downloadcore-a078b11b1afb308e2976300f32a9f3f70d4862f3.tar.gz
core-a078b11b1afb308e2976300f32a9f3f70d4862f3.tar.xz
core-a078b11b1afb308e2976300f32a9f3f70d4862f3.zip
* cleaned all attributes that are marked obsolete by ticket #243 and a couple
more (see #243 for the list) * added all non-plugin-attrs into the hash-value that is being used to determine changes to the set of attributes & plugins git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2056 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rw-r--r--config-db/OpenSLX/AttributeRoster.pm266
-rw-r--r--config-db/OpenSLX/ConfigDB.pm6
2 files changed, 89 insertions, 183 deletions
diff --git a/config-db/OpenSLX/AttributeRoster.pm b/config-db/OpenSLX/AttributeRoster.pm
index ddd2599d..ac5c9bd4 100644
--- a/config-db/OpenSLX/AttributeRoster.pm
+++ b/config-db/OpenSLX/AttributeRoster.pm
@@ -16,6 +16,8 @@ package OpenSLX::AttributeRoster;
use strict;
use warnings;
+use Digest::MD5 qw(md5_hex);
+
use OpenSLX::Basics;
use OpenSLX::OSPlugin::Engine;
use OpenSLX::OSPlugin::Roster;
@@ -67,76 +69,6 @@ sub _init
content_descr => undef,
default => 'de',
},
- 'dm_allow_shutdown' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'user',
- },
- 'hw_graphic' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
- 'hw_monitor' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
- 'hw_mouse' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
- 'netbios_workgroup' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'slx-network',
- },
- 'nis_domain' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
- 'nis_servers' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
'ramfs_fsmods' => {
applies_to_systems => 1,
applies_to_clients => 0,
@@ -167,16 +99,17 @@ sub _init
content_descr => 'a space-separated list of NIC modules',
default => 'forcedeth e1000 e100 tg3 via-rhine r8169 pcnet32',
},
- 'sane_scanner' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
+# TODO: check if we still need this, as it is not being used anywhere
+# 'sane_scanner' => {
+# applies_to_systems => 1,
+# applies_to_clients => 1,
+# description => unshiftHereDoc(<<' End-of-Here'),
+# !!!descriptive text missing here!!!
+# End-of-Here
+# content_regex => undef,
+# content_descr => undef,
+# default => '',
+# },
'scratch' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -187,26 +120,28 @@ sub _init
content_descr => undef,
default => '',
},
- 'slxgrp' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => '',
- },
- 'start_alsasound' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'yes',
- },
+# TODO: check if we still need this, as it is not being used anywhere
+# 'slxgrp' => {
+# applies_to_systems => 1,
+# applies_to_clients => 1,
+# description => unshiftHereDoc(<<' End-of-Here'),
+# !!!descriptive text missing here!!!
+# End-of-Here
+# content_regex => undef,
+# content_descr => undef,
+# default => '',
+# },
+# TODO: check if we still need this, as it is not being used anywhere
+# 'start_alsasound' => {
+# applies_to_systems => 1,
+# applies_to_clients => 1,
+# description => unshiftHereDoc(<<' End-of-Here'),
+# !!!descriptive text missing here!!!
+# End-of-Here
+# content_regex => undef,
+# content_descr => undef,
+# default => 'yes',
+# },
'start_atd' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -257,26 +192,28 @@ sub _init
content_descr => undef,
default => 'no',
},
- 'start_printer' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'no',
- },
- 'start_samba' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'may',
- },
+# TODO: check if we still need this, as it is not being used anywhere
+# 'start_printer' => {
+# applies_to_systems => 1,
+# applies_to_clients => 1,
+# description => unshiftHereDoc(<<' End-of-Here'),
+# !!!descriptive text missing here!!!
+# End-of-Here
+# content_regex => undef,
+# content_descr => undef,
+# default => 'no',
+# },
+# TODO: check if we still need this, as it is not being used anywhere
+# 'start_samba' => {
+# applies_to_systems => 1,
+# applies_to_clients => 1,
+# description => unshiftHereDoc(<<' End-of-Here'),
+# !!!descriptive text missing here!!!
+# End-of-Here
+# content_regex => undef,
+# content_descr => undef,
+# default => 'may',
+# },
'start_snmp' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -297,46 +234,6 @@ sub _init
content_descr => undef,
default => 'yes',
},
- 'start_syslogd' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'yes',
- },
- 'start_x' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'yes',
- },
- 'start_xdmcp' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'kdm',
- },
- 'tex_enable' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'no',
- },
'timezone' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -347,26 +244,6 @@ sub _init
content_descr => undef,
default => 'Europe/Berlin',
},
- 'tvout' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'no',
- },
- 'vmware' => {
- applies_to_systems => 1,
- applies_to_clients => 1,
- description => unshiftHereDoc(<<' End-of-Here'),
- !!!descriptive text missing here!!!
- End-of-Here
- content_regex => undef,
- content_descr => undef,
- default => 'no',
- },
);
# and add all plugin attributes, too
@@ -577,4 +454,33 @@ sub findProblematicValues
return \@problems;
}
+=item C<computeMD5HashOverAllAttrs()>
+
+Returns a MD5 hash representing the list of all attributes (including plugins).
+
+=cut
+
+sub computeMD5HashOverAllAttrs
+{
+ my $class = shift;
+
+ $class->_init() if !%AttributeInfo;
+
+ my %attrNames;
+ @attrNames{keys %AttributeInfo} = ();
+
+ my $pluginInfo = OpenSLX::OSPlugin::Roster->getAvailablePlugins();
+ if ($pluginInfo) {
+ foreach my $pluginName (sort keys %$pluginInfo) {
+ my $attrInfo
+ = OpenSLX::OSPlugin::Roster->getPluginAttrInfo($pluginName);
+ @attrNames{keys %$attrInfo} = ();
+ }
+ }
+
+ my $attrNamesAsString = join ',', sort keys %attrNames;
+
+ return md5_hex($attrNamesAsString);
+}
+
1;
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm
index 37bc1404..b781a08a 100644
--- a/config-db/OpenSLX/ConfigDB.pm
+++ b/config-db/OpenSLX/ConfigDB.pm
@@ -190,10 +190,10 @@ sub connect ## no critic (ProhibitBuiltinHomonyms)
$self->{'db-schema'}->checkAndUpgradeDBSchemaIfNecessary($self)
or die _tr('unable to check/update DB schema!');
- # check if any plugins (or plugin-attributes) have been added/removed since
+ # check if any attributes or plugins have been added/removed since
# last DB-session and bring the DB up-to-date, if so
- my $pluginInfoHashVal
- = OpenSLX::OSPlugin::Roster->computeMD5HashOverAvailablePlugins();
+ my $pluginInfoHashVal
+ = OpenSLX::AttributeRoster->computeMD5HashOverAllAttrs();
my $pluginInfoHashValInDB = $metaDB->schemaFetchPluginInfoHashVal();
vlog(1, "plugin-info-hashes: $pluginInfoHashVal <=> $pluginInfoHashValInDB");
if ($pluginInfoHashValInDB ne $pluginInfoHashVal) {