git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3bc12a1
)
fail silently if there is a problem adding a node to the rspec
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 28 Mar 2011 20:54:20 +0000
(16:54 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 28 Mar 2011 20:54:20 +0000
(16:54 -0400)
sfa/plc/network.py
patch
|
blob
|
history
diff --git
a/sfa/plc/network.py
b/sfa/plc/network.py
index
d8f0c1d
..
9388e08
100644
(file)
--- a/
sfa/plc/network.py
+++ b/
sfa/plc/network.py
@@
-347,6
+347,7
@@
class Network:
try:
val = self.sites[id]
except:
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
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}):
"""
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):
return dict(tmp)
def get_ifaces(self, api):