diff options
author | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2008-04-30 03:03:57 -0400 |
---|---|---|
committer | Adrian Likins <alikins@grimlock.devel.redhat.com> | 2008-04-30 03:03:57 -0400 |
commit | 448a55ad6456d85c0ae2fa6cb18814d8d07b6c69 (patch) | |
tree | 1b0f0bd7575e5796da720d95b491034c87973866 /func/minion/utils.py | |
parent | 708d323a3e4a057891b29950e35f14c62f791c7e (diff) | |
download | func-448a55ad6456d85c0ae2fa6cb18814d8d07b6c69.tar.gz func-448a55ad6456d85c0ae2fa6cb18814d8d07b6c69.tar.xz func-448a55ad6456d85c0ae2fa6cb18814d8d07b6c69.zip |
new file acls.py, start trying to write a class for the acls, so we can
support reading/writing/updating them, and eventually, a minion module
for it.
Diffstat (limited to 'func/minion/utils.py')
-rwxr-xr-x | func/minion/utils.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/func/minion/utils.py b/func/minion/utils.py index acdf613..e8d1b39 100755 --- a/func/minion/utils.py +++ b/func/minion/utils.py @@ -93,42 +93,3 @@ def daemonize(pidfile=None): if pidfile is not None: open(pidfile, "w").write(str(pid)) sys.exit(0) - -def get_acls_from_config(acldir='/etc/func/minion-acl.d'): - """ - takes a dir of .acl files - returns a dict of hostname+hash = [methods, to, run] - - """ - - acls = {} - if not os.path.exists(acldir): - print 'acl dir does not exist: %s' % acldir - return acls - - # get the set of files - acl_glob = '%s/*.acl' % acldir - files = glob.glob(acl_glob) - - for acl_file in files: - - try: - fo = open(acl_file, 'r') - except (IOError, OSError), e: - print 'cannot open acl config file: %s - %s' % (acl_file, e) - continue - - for line in fo.readlines(): - if line.startswith('#'): continue - if line.strip() == '': continue - line = line.replace('\n', '') - (host, methods) = line.split('=') - host = host.strip().lower() - methods = methods.strip() - methods = methods.replace(',',' ') - methods = methods.split() - if not acls.has_key(host): - acls[host] = [] - acls[host].extend(methods) - - return acls |