raise exception if there are no slivers
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 26 Dec 2011 04:42:17 +0000 (23:42 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 26 Dec 2011 04:42:17 +0000 (23:42 -0500)
sfa/plc/pldriver.py

index e153894..3f01e7f 100644 (file)
@@ -625,6 +625,10 @@ class PlDriver (Driver):
         # report about the local nodes only
         nodes = self.shell.GetNodes({'node_id':slice['node_ids'],'peer_id':None},
                               ['node_id', 'hostname', 'site_id', 'boot_state', 'last_contact'])
+
+        if len(nodes) == 0:
+            raise SliverDoesNotExist("You have not allocated any slivers here") 
+
         site_ids = [node['site_id'] for node in nodes]
     
         result = {}