+
+# Check if the site is a pending site that needs to be approved.
+def isPendingSite(loginbase):
+ api = xmlrpclib.Server(auth.server, verbose=False)
+ try:
+ site = api.GetSites(auth.auth, loginbase)[0]
+ except Exception, exc:
+ login.info("ERROR: No site %s" % loginbase)
+ return False
+
+ def all_disabled(person_ids):
+ persons = api.GetPersons(auth.auth, person_ids)
+ for person in persons:
+ if person['enabled']:
+ return False
+ return True
+
+ if not site['max_slices'] and not site['node_ids'] and all_disabled(site['person_ids']):
+ return True
+
+ return False
+
+