From b5f4d47629c7366ec9911af523cd589f9d483091 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sun, 25 Dec 2011 23:42:17 -0500 Subject: [PATCH] raise exception if there are no slivers --- sfa/plc/pldriver.py | 4 ++++ 1 file changed, 4 insertions(+) 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 = {} -- 2.47.0