Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 29 Mar 2011 13:31:06 +0000 (15:31 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 29 Mar 2011 13:31:06 +0000 (15:31 +0200)
sfa/plc/network.py

index 5834f4f..c84ffa5 100644 (file)
@@ -349,6 +349,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
     
@@ -568,8 +569,12 @@ 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:
+                t = node['node_id'], Node(self, node)
+                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):