gracefully handle case where the sliver has not yet been instantiated
authorMarc Fiuczynski <mef@cs.princeton.edu>
Sat, 30 Jan 2010 04:41:15 +0000 (04:41 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Sat, 30 Jan 2010 04:41:15 +0000 (04:41 +0000)
plugins/sliverauth.py

index bf35830..634d648 100644 (file)
@@ -50,6 +50,14 @@ def GetSlivers(data, config, plc):
         return
 
     for sliver in data['slivers']:
+        path = '/vservers/%s' % sliver['name']
+        if not os.path.exists(path):
+            # ignore all non-plc-instantiated slivers
+            instantiation = sliver.get('instantiation','')
+            if instantiation == 'plc-instantiated':
+                logger.log("sliverauth: plc-instantiated slice %s does not yet exist. IGNORING!" % sliver['name'])
+            continue
+        
         found_hmac = False
         for attribute in sliver['attributes']:
             name = attribute.get('tagname',attribute.get('name',''))