organize the 24 dependencies of invirt-web a bit
[invirt/packages/invirt-web.git] / code / cache_acls.py
index 1a23587..fe69815 100644 (file)
@@ -10,8 +10,12 @@ def expandLocker(name):
         groups = getafsgroups.getLockerAcl(name)
     except getafsgroups.AfsProcessError, e:
         if e.message.startswith("fs: You don't have the required access rights on"):
-            groups = []
-        raise
+            return []
+        elif e.message.endswith("doesn't exist\n"):
+            # presumably deactivated
+            return []
+        else:
+            raise
     cell = getafsgroups.getCell(name)
     ans = set()
     for group in groups:
@@ -42,7 +46,8 @@ def expandName(name):
 def accessList(m):
     people = set()
     people.update(expandLocker(m.owner))
-    people.update(expandName(m.administrator))
+    if m.administrator is not None:
+        people.update(expandName(m.administrator))
     return people
 
 def refreshMachine(m):