From d49ec0cce12b8da989b7efe75d612b0421155f63 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 10 Oct 2007 14:14:44 +0000 Subject: Plugin updates: Account sudoers perms, Cfg recreate bug, Deps error path git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3784 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Account.py | 2 +- src/lib/Server/Plugins/Cfg.py | 8 +++++--- src/lib/Server/Plugins/Deps.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/lib/Server') diff --git a/src/lib/Server/Plugins/Account.py b/src/lib/Server/Plugins/Account.py index ac2eba836..86cdab9f3 100644 --- a/src/lib/Server/Plugins/Account.py +++ b/src/lib/Server/Plugins/Account.py @@ -80,6 +80,6 @@ class Account(Bcfg2.Server.Plugin.Plugin): entry.text = self.repository.entries['static.sudoers'].data entry.text += "".join(["%s ALL=(ALL) ALL\n" % uname \ for uname in superusers]) - perms = {'owner':'root', 'group':'0', 'perms':'0400'} + perms = {'owner':'root', 'group':'0', 'perms':'0440'} [entry.attrib.__setitem__(key, value) for (key, value) \ in perms.iteritems()] diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py index afda27cde..987cc2da8 100644 --- a/src/lib/Server/Plugins/Cfg.py +++ b/src/lib/Server/Plugins/Cfg.py @@ -133,15 +133,17 @@ class ConfigFileEntry(object): return try: - self.fragments.append(FileEntry(self.path, name)) - self.fragments.sort() + if name not in [ent.name for ent in self.fragments]: + self.fragments.append(FileEntry(self.path, name)) + self.fragments.sort() except SpecificityError: return def HandleEvent(self, event): '''Handle FAM updates''' action = event.code2str() - #logger.debug("Got event %s for %s" % (action, event.filename)) + #if self.path.endswith('/etc/passwd'): + # logger.debug("Got event %s for %s" % (action, event.filename)) if event.filename in [':info', 'info']: if action in ['changed', 'exists', 'created']: return self.read_info(event.filename) diff --git a/src/lib/Server/Plugins/Deps.py b/src/lib/Server/Plugins/Deps.py index d63f0b204..eb215a564 100644 --- a/src/lib/Server/Plugins/Deps.py +++ b/src/lib/Server/Plugins/Deps.py @@ -92,5 +92,8 @@ class Deps(Bcfg2.Server.Plugin.PrioDir): newstruct = lxml.etree.Element("Independant") for tag, name in prereqs: - lxml.etree.SubElement(newstruct, tag, name=name) + try: + lxml.etree.SubElement(newstruct, tag, name=name) + except: + self.logger("Failed to add dep entry for %s:%s" % (tag, name)) return newstruct -- cgit v1.2.3-1-g7c22