From 967c76d15ba2ed299e9975186db01b5db68418da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Tue, 5 Jul 2011 18:01:27 +0200 Subject: bcfg2-admin compare: Handle POSIX entries Let "bcfg2-admin compare" handle POSIX tags instead of the old-style entries. While at it, add support for all attributes which might show up in configuration specifications. --- src/lib/Server/Admin/Compare.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Admin/Compare.py b/src/lib/Server/Admin/Compare.py index cd6a6e42e..7a28a8560 100644 --- a/src/lib/Server/Admin/Compare.py +++ b/src/lib/Server/Admin/Compare.py @@ -14,13 +14,19 @@ class Compare(Bcfg2.Server.Admin.Mode): def __init__(self, configfile): Bcfg2.Server.Admin.Mode.__init__(self, configfile) - self.important = {'Package': ['name', 'version'], - 'Service': ['name', 'status'], - 'Directory': ['name', 'owner', 'group', 'perms'], - 'SymLink': ['name', 'to'], - 'ConfigFile': ['name', 'owner', 'group', 'perms'], - 'Permissions': ['name', 'perms'], - 'PostInstall': ['name']} + self.important = {'Path': ['name', 'type', 'owner', 'group', 'perms', + 'important', 'paranoid', 'sensitive', + 'dev_type', 'major', 'minor', 'prune', + 'encoding', 'empty', 'to', 'recursive', + 'vcstype', 'sourceurl', 'revision'], + 'Package': ['name', 'type', 'version', 'simplefile', + 'verify'], + 'Service': ['name', 'type', 'status', 'mode', + 'target', 'sequence', 'parameters'], + 'Action': ['name', 'timing', 'when', 'status', + 'command'], + 'PostInstall': ['name'] + } def compareStructures(self, new, old): for child in new.getchildren(): @@ -34,7 +40,7 @@ class Compare(Bcfg2.Server.Admin.Mode): (child.tag, child.get('name'))) continue elif len(equiv) >= 1: - if child.tag == 'ConfigFile': + if child.tag == 'Path' and child.get('type') == 'file': if child.text != equiv[0].text: print(" %s %s contents differ" \ % (child.tag, child.get('name'))) -- cgit v1.2.3-1-g7c22