check/set slice url and description when creating a new slice
authorMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 21 Nov 2013 13:32:25 +0000 (14:32 +0100)
committerMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 21 Nov 2013 13:32:25 +0000 (14:32 +0100)
sfa/planetlab/pldriver.py

index 0978a57..d742394 100644 (file)
@@ -126,6 +126,10 @@ class PlDriver (Driver):
                     pl_record.pop(key)
             slices = self.shell.GetSlices([pl_record['name']])
             if not slices:
+                 if not pl_record.get('url', None) or not pl_record.get('description', None):
+                     pl_record['url'] = hrn
+                     pl_record['description'] = hrn
+
                  pointer = self.shell.AddSlice(pl_record)
                  self.shell.SetSliceHrn(int(pointer), hrn)
             else: