From: Tony Mack Date: Mon, 28 Mar 2011 20:54:20 +0000 (-0400) Subject: fail silently if there is a problem adding a node to the rspec X-Git-Tag: sfa-1.0-21-ckp1~74^2~40^2~1^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=d8902f7273a996b5806a6d04c9db1fc397c0342f;p=sfa.git fail silently if there is a problem adding a node to the rspec --- diff --git a/sfa/plc/network.py b/sfa/plc/network.py index d8f0c1dd..9388e082 100644 --- a/sfa/plc/network.py +++ b/sfa/plc/network.py @@ -347,6 +347,7 @@ class Network: try: val = self.sites[id] except: + self.api.logger.error("Invalid RSpec: site ID %s not found" % id ) raise InvalidRSpec("site ID %s not found" % id) return val @@ -566,8 +567,14 @@ class Network: """ tmp = [] for node in api.plshell.GetNodes(api.plauth, {'peer_id': None}): - t = node['node_id'], Node(self, node) - tmp.append(t) + try: + nodeObj = Node(self, node) + if nodeObj.site != None: + t = node['node_id'], nodeObj + tmp.append(t) + except: + self.api.logger.error("Failed to add node %s (%s) to RSpec" % (node['hostname'], node['node_id'])) + return dict(tmp) def get_ifaces(self, api):