From c70fbdb6afe93b67b86ad70804d7cc58155bf61b Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski <mef@cs.princeton.edu> Date: Sat, 30 Jan 2010 04:41:15 +0000 Subject: [PATCH] gracefully handle case where the sliver has not yet been instantiated --- plugins/sliverauth.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/sliverauth.py b/plugins/sliverauth.py index bf35830..634d648 100644 --- a/plugins/sliverauth.py +++ b/plugins/sliverauth.py @@ -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','')) -- 2.47.0