skip aggregates with incomplete connection info
[sfa.git] / geni / slicemgr.py
index 8584043..5b8a43a 100644 (file)
@@ -51,7 +51,8 @@ class SliceMgr(GeniServer):
         
         # Get list of aggregates this sm talks to
         aggregates_file = self.server_basedir + os.sep + 'aggregates.xml'
-        self.aggregate_info = XmlStorage(aggregates_file, {'aggregates': {'aggregate': []}} )
+        connection_dict = {'hrn': '', 'addr': '', 'port': ''}
+        self.aggregate_info = XmlStorage(aggregates_file, {'aggregates': {'aggregate': [connection_dict]}} )
         self.aggregate_info.load()
         
         # Get cached list of nodes (rspec) 
@@ -129,6 +130,8 @@ class SliceMgr(GeniServer):
             for aggregate in aggregates:         
                 # create xmlrpc connection using GeniClient
                 hrn, address, port = aggregate['hrn'], aggregate['addr'], aggregate['port']
+                if not hrn or not address or not port:
+                    continue
                 url = 'http://%(address)s:%(port)s' % locals()
                 self.aggregates[hrn] = GeniClient(url, self.key_file, self.cert_file)