• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Révisiona3ab5407b549c59559b5b9b6a16066be2015c7ba (tree)
l'heure2011-04-28 23:48:33
AuteurDave Brondsema <dbrondsema@geek...>
CommiterDave Brondsema

Message de Log

[#1909] more resilient to already converted data

Signed-off-by: Dave Brondsema <dbrondsema@geek.net>

Change Summary

Modification

--- a/scripts/update-acls.py
+++ b/scripts/update-acls.py
@@ -84,6 +84,10 @@ def update_project_acl(project_doc):
8484
8585 def update_neighborhood_acl(neighborhood_doc, init_doc):
8686 '''Convert nbhd admins users to --init-- project admins'''
87+ if 'acl' not in neighborhood_doc:
88+ log.warning('Neighborhood %s is already updated' % neighborhood_doc['name'])
89+ return
90+
8791 if TEST: log.info('Update nbhd %s', neighborhood_doc['name'])
8892 if 'acl' not in neighborhood_doc:
8993 log.warning('Neighborhood %s already updated', neighborhood_doc['name'])
@@ -112,6 +116,10 @@ def update_neighborhood_acl(neighborhood_doc, init_doc):
112116
113117 def simple_acl_update(doc):
114118 '''Update dict-style to list-style ACL'''
119+ if not isinstance(doc['acl'], dict):
120+ log.warning('Already upgraded %s' % doc)
121+ return
122+
115123 new_acl = []
116124 for perm, role_ids in sorted(doc['acl'].iteritems()):
117125 for rid in role_ids: