summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Tappe2008-08-20 15:22:49 +0200
committerOliver Tappe2008-08-20 15:22:49 +0200
commita078b11b1afb308e2976300f32a9f3f70d4862f3 (patch)
tree60eb7af2d39dd66ba108a39a9a17e962c1a9fec1
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
-rw-r--r--config-db/OpenSLX/AttributeRoster.pm266
-rw-r--r--config-db/OpenSLX/ConfigDB.pm6
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Roster.pm23
3 files changed, 89 insertions, 206 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) {
diff --git a/os-plugins/OpenSLX/OSPlugin/Roster.pm b/os-plugins/OpenSLX/OSPlugin/Roster.pm
index 93887ec7..7bfed044 100644
--- a/os-plugins/OpenSLX/OSPlugin/Roster.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Roster.pm
@@ -18,7 +18,6 @@ use warnings;
use OpenSLX::Basics;
use Clone qw(clone);
-use Digest::MD5 qw(md5_hex);
my %plugins;
@@ -41,28 +40,6 @@ sub getAvailablePlugins
return \%pluginInfo;
}
-=item C<computeMD5HashOverAvailablePlugins()>
-
-Returns a MD5 hash representing the list of available plugins and all their
-attributes.
-
-=cut
-
-sub computeMD5HashOverAvailablePlugins
-{
- my $class = shift;
-
- $class->_init() if !%plugins;
-
- my $pluginInfoString = '';
- foreach my $pluginName (sort keys %plugins) {
- my $attrInfo = $plugins{$pluginName}->getAttrInfo();
- my $attrList = join ',', sort keys %$attrInfo;
- $pluginInfoString .= $pluginName . '(' . $attrList . ')';
- }
- return md5_hex($pluginInfoString);
-}
-
=item C<getPlugin()>
Returns an instance of the plugin with the given name