diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-02-11 21:16:53 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-02-11 21:16:53 +0000 |
commit | bdb04b51eb6eefecfd7eed8b2362058bb635411e (patch) | |
tree | 7e5cb1f04d4d5f666b3e2dc8b877ae99cf1919cd /src/lib | |
parent | 668ecd8345aa2943187df23c1130c1dceaa564b1 (diff) | |
download | bcfg2-bdb04b51eb6eefecfd7eed8b2362058bb635411e.tar.gz bcfg2-bdb04b51eb6eefecfd7eed8b2362058bb635411e.tar.bz2 bcfg2-bdb04b51eb6eefecfd7eed8b2362058bb635411e.zip |
Pylint fixes for Account Plugin
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5075 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Client/Tools/Portage.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Account.py | 23 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/lib/Client/Tools/Portage.py b/src/lib/Client/Tools/Portage.py index 8f7875839..dc13a05d0 100644 --- a/src/lib/Client/Tools/Portage.py +++ b/src/lib/Client/Tools/Portage.py @@ -45,7 +45,7 @@ class Portage(Bcfg2.Client.Tools.PkgTool): entry.get('verify', 'true') == 'true': output = self.cmd.run \ ("/usr/bin/equery check '=%s-%s' 2>&1 |grep '!!!' | awk '{print $2}'" \ - % (entry.get('name'), entry.get('version')))[1] + % (entry.get('name'), entry.get('version')))[1] if [filename for filename in output \ if filename not in modlist]: return False diff --git a/src/lib/Server/Plugins/Account.py b/src/lib/Server/Plugins/Account.py index 86892dcaf..f73069de3 100644 --- a/src/lib/Server/Plugins/Account.py +++ b/src/lib/Server/Plugins/Account.py @@ -21,14 +21,15 @@ class Account(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) Bcfg2.Server.Plugin.Generator.__init__(self) self.Entries = {'ConfigFile':{'/etc/passwd':self.from_yp_cb, - '/etc/group':self.from_yp_cb, - '/etc/security/limits.conf':self.gen_limits_cb, - '/root/.ssh/authorized_keys':self.gen_root_keys_cb, - '/etc/sudoers':self.gen_sudoers}} + '/etc/group':self.from_yp_cb, + '/etc/security/limits.conf':self.gen_limits_cb, + '/root/.ssh/authorized_keys':self.gen_root_keys_cb, + '/etc/sudoers':self.gen_sudoers}} try: self.repository = Bcfg2.Server.Plugin.DirectoryBacked(self.data, self.core.fam) except: - self.logger.error("Failed to load repos: %s, %s" % (self.data, "%s/ssh" % (self.data))) + self.logger.error("Failed to load repos: %s, %s" % \ + (self.data, "%s/ssh" % (self.data))) raise Bcfg2.Server.Plugin.PluginInitError def from_yp_cb(self, entry, metadata): @@ -37,16 +38,20 @@ class Account(Bcfg2.Server.Plugin.Plugin, entry.text = self.repository.entries["static.%s" % (fname)].data entry.text += self.repository.entries["dyn.%s" % (fname)].data perms = {'owner':'root', 'group':'root', 'perms':'0644'} - [entry.attrib.__setitem__(key, value) for (key, value) in perms.iteritems()] + [entry.attrib.__setitem__(key, value) for (key, value) in \ + perms.iteritems()] def gen_limits_cb(self, entry, metadata): '''Build limits entries based on current ACLs''' entry.text = self.repository.entries["static.limits.conf"].data superusers = self.repository.entries["superusers"].data.split() - useraccess = [line.split(':') for line in self.repository.entries["useraccess"].data.split()] - users = [user for (user, host) in useraccess if host == metadata.hostname.split('.')[0]] + useraccess = [line.split(':') for line in \ + self.repository.entries["useraccess"].data.split()] + users = [user for (user, host) in \ + useraccess if host == metadata.hostname.split('.')[0]] perms = {'owner':'root', 'group':'root', 'perms':'0600'} - [entry.attrib.__setitem__(key, value) for (key, value) in perms.iteritems()] + [entry.attrib.__setitem__(key, value) for (key, value) in \ + perms.iteritems()] entry.text += "".join(["%s hard maxlogins 1024\n" % uname for uname in superusers + users]) if "*" not in users: entry.text += "* hard maxlogins 0\n" |