From 61e2d8a6e8c59157dfdfd247cb8d6c01405ff9fb Mon Sep 17 00:00:00 2001 From: Jon Stanley Date: Thu, 10 Dec 2009 00:17:18 -0500 Subject: Fix acl_list in main() to always be a list. --- setacls.py | 20 +++++++++----------- 1 file 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() -- cgit