summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Account.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-02-11 21:16:53 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-02-11 21:16:53 +0000
commitbdb04b51eb6eefecfd7eed8b2362058bb635411e (patch)
tree7e5cb1f04d4d5f666b3e2dc8b877ae99cf1919cd /src/lib/Server/Plugins/Account.py
parent668ecd8345aa2943187df23c1130c1dceaa564b1 (diff)
downloadbcfg2-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/Server/Plugins/Account.py')
-rw-r--r--src/lib/Server/Plugins/Account.py23
1 files changed, 14 insertions, 9 deletions
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"