From a078b11b1afb308e2976300f32a9f3f70d4862f3 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 20 Aug 2008 13:22:49 +0000 Subject: * 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 --- config-db/OpenSLX/AttributeRoster.pm | 266 +++++++++++------------------------ config-db/OpenSLX/ConfigDB.pm | 6 +- 2 files changed, 89 insertions(+), 183 deletions(-) (limited to 'config-db') 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 + +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) { -- cgit v1.2.3-55-g7522