From: Tony Mack Date: Mon, 26 Dec 2011 04:42:17 +0000 (-0500) Subject: raise exception if there are no slivers X-Git-Tag: sfa-2.0-7~13^2~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b5f4d47629c7366ec9911af523cd589f9d483091;p=sfa.git raise exception if there are no slivers --- diff --git a/sfa/plc/pldriver.py b/sfa/plc/pldriver.py index e1538942..3f01e7f3 100644 --- a/sfa/plc/pldriver.py +++ b/sfa/plc/pldriver.py @@ -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 = {}