summaryrefslogtreecommitdiffstats
path: root/setacls.py
diff options
context:
space:
mode:
authorJon Stanley <jonstanley@gmail.com>2009-12-09 13:16:31 -0500
committerJon Stanley <jonstanley@gmail.com>2009-12-09 13:16:31 -0500
commitda9663505314a213e44e3de0a0a4723fbb10ffdf (patch)
tree6e13f31db502ce5fe79172355365d9eae535c564 /setacls.py
parent7e1d4fcc1e94ff04e3823832a556997b6d8410da (diff)
downloadcvssetfacl-da9663505314a213e44e3de0a0a4723fbb10ffdf.tar.gz
cvssetfacl-da9663505314a213e44e3de0a0a4723fbb10ffdf.tar.xz
cvssetfacl-da9663505314a213e44e3de0a0a4723fbb10ffdf.zip
Implement get_one() functionality.
I can't be sure that this actually works until I can have a machine to set the ACL's on for real later tonight
Diffstat (limited to 'setacls.py')
-rwxr-xr-xsetacls.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/setacls.py b/setacls.py
index 527c64f..10847ca 100755
--- a/setacls.py
+++ b/setacls.py
@@ -33,7 +33,7 @@ version = '0.1'
newacls = {}
try:
- avail_file = open('avail.minimal','r')
+ avail_file = open('avail.pkgs','r')
except IOError:
sys.stderr.write('Cannot open avail file!\n')
sys.exit(1)
@@ -41,9 +41,14 @@ except IOError:
pkgs = {}
def get_one(pkg):
+ '''Returns applicable ACL's for a given package. Supports multiple matches,
+ returns a dict of paths that we want to set and ACL's'''
pkg_ret = {}
+ item_regex = re.compile('rpms/%s.*' % pkg)
for item in pkgs.keys():
- acl_list = pkgs[item].strip().split(' | ')[1].split(',')
+ if item_regex.match(item):
+ pkg_ret[item] = build_acl(pkgs[item])
+ return pkg_ret
def get_all():
'''Returns all packages in a dict of ACL objects. The keys of the dict are paths
@@ -135,12 +140,12 @@ def main():
parsed, pkg = line.strip().split(' | ')[1].split(','), \
line.strip().split(' | ')[2]
pkgs[pkg] = parsed
- print pkgs
+ #print pkgs
if __name__ == '__main__':
main()
- get_all()
- print newacls
- for acl in newacls.keys():
- print newacls[acl]
+ get_one('389')
+ #print newacls
+ #for acl in newacls.keys():
+ # print newacls[acl]