more graceful log message when GetSlivers() API called failed
authorMarc Fiuczynski <mef@cs.princeton.edu>
Sat, 30 Jan 2010 04:42:17 +0000 (04:42 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Sat, 30 Jan 2010 04:42:17 +0000 (04:42 +0000)
plugins/vsys.py
plugins/vsys_privs.py

index 05b87cd..f1abfd9 100644 (file)
@@ -15,6 +15,11 @@ def start(options, conf):
 
 def GetSlivers(data, config=None, plc=None):
     """For each sliver with the vsys attribute, set the script ACL, create the vsys directory in the slice, and restart vsys."""
+
+    if 'slivers' not in data:
+        logger.log("vsys: getslivers data lack's sliver information. IGNORING!")
+        return
+
     # Touch ACLs and create dict of available
     scripts = {}
     for script in touchAcls(): scripts[script] = []
index 5cd40a2..e6d8754 100755 (executable)
@@ -20,6 +20,12 @@ def start(options, conf):
         logger.log("Created vsys attributes dir")
 
 def GetSlivers(data, config=None, plc=None):
+
+    if 'slivers' not in data:
+        logger.log("vsys_privs: getslivers data lack's sliver information. IGNORING!")
+        return
+
+
     privs = {}
 
     # Parse attributes and update dict of scripts