summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Stanley <jonstanley@gmail.com>2009-12-10 00:17:18 -0500
committerJon Stanley <jonstanley@gmail.com>2009-12-10 00:17:18 -0500
commit61e2d8a6e8c59157dfdfd247cb8d6c01405ff9fb (patch)
tree2f8dca00175e84690b449e3f567b7574dee48670
parent9e15ed21337ca8702f8466ff73c83223e36985ec (diff)
downloadcvssetfacl-61e2d8a6e8c59157dfdfd247cb8d6c01405ff9fb.tar.gz
cvssetfacl-61e2d8a6e8c59157dfdfd247cb8d6c01405ff9fb.tar.xz
cvssetfacl-61e2d8a6e8c59157dfdfd247cb8d6c01405ff9fb.zip
Fix acl_list in main() to always be a list.
-rwxr-xr-xsetacls.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/setacls.py b/setacls.py
index f42de0a..81b3479 100755
--- a/setacls.py
+++ b/setacls.py
@@ -187,29 +187,27 @@ def main():
sys.stderr.write('You cannot specify both -a and a list of packages\n')
sys.exit(1)
+ # something of a hack here - this list will only ever have one element.
+ # This is for support of multiple command line arguments and making sure
+ # that what's around is always a list. See below for when it can have more
+ # than one
+
if options.all:
- acl_list = get_all()
+ acl_list = []
+ acl_list.append = get_all()
if options.dr:
dry_run = True
else:
dry_run = False
- # this is something of a hack in order to support multiple packages being
- # specified on the command line. What this does is build a list of dicts
- # of ACL object. Later we'll check if acl_list is a dict or a list, and
- # DTRT.
-
if args:
acl_list = []
for arg in args:
acl_list.append(get_one(arg))
- if type(acl_list) == 'list':
- for acl_dict in acl_list:
- apply_acls(acl_dict, dry_run)
- else:
- apply_acls(acl_list, dry_run)
+ for acl_dict in acl_list:
+ apply_acls(acl_dict, dry_run)
if __name__ == '__main__':
main()