Created
April 28, 2011 14:44
-
-
Save brondsem/946481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/scripts/update-acls.py b/scripts/update-acls.py | |
index 5893bee..ff0a3de 100644 | |
--- a/scripts/update-acls.py | |
+++ b/scripts/update-acls.py | |
@@ -84,6 +84,10 @@ def update_project_acl(project_doc): | |
def update_neighborhood_acl(neighborhood_doc, init_doc): | |
'''Convert nbhd admins users to --init-- project admins''' | |
+ if 'acl' not in neighborhood_doc: | |
+ log.warning('Neighborhood %s is already updated' % neighborhood_doc['name']) | |
+ return | |
+ | |
if TEST: log.info('Update nbhd %s', neighborhood_doc['name']) | |
if 'acl' not in neighborhood_doc: | |
log.warning('Neighborhood %s already updated', neighborhood_doc['name']) | |
@@ -112,6 +116,10 @@ def update_neighborhood_acl(neighborhood_doc, init_doc): | |
def simple_acl_update(doc): | |
'''Update dict-style to list-style ACL''' | |
+ if not isinstance(doc['acl'], dict): | |
+ # already upgraded | |
+ return | |
+ | |
new_acl = [] | |
for perm, role_ids in sorted(doc['acl'].iteritems()): | |
for rid in role_ids: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment