in list(), no longer check if PlanetLab record exists
[sfa.git] / geni / registry.py
index eb7e599..7308d53 100644 (file)
@@ -194,15 +194,18 @@ class Registry(GeniServer):
         create an GeniClient connection to each. 
         """
         self.registries= {}
+        required_fields = ['hrn', 'addr', 'port']
         registries = self.registry_info['registries']['registry']
         if isinstance(registries, dict):
             registries = [registries]
         if isinstance(registries, list):
             for registry in registries:
                 # create xmlrpc connection using GeniClient
+                if not set(required_fields).issubset(registry.keys()):
+                    continue  
+                hrn, address, port = registry['hrn'], registry['addr'], registry['port']
                 if not hrn or not address or not port:
                     continue
-                hrn, address, port = registry['hrn'], registry['addr'], registry['port']
                 url = 'http://%(address)s:%(port)s' % locals()
                 self.registries[hrn] = GeniClient(url, self.key_file, self.cert_file)
 
@@ -709,24 +712,7 @@ class Registry(GeniServer):
 
         records = table.list()
 
-        good_records = []
-        for record in records:
-            try:
-                self.fill_record_info(record)
-                good_records.append(record)
-            except PlanetLabRecordDoesNotExist:
-                # silently drop the ones that are missing in PL.
-                # is this the right thing to do?
-                print "ignoring geni record ", record.get_name(), " because pl record does not exist"
-                table.remove(record)
-
-        dicts = []
-        for record in good_records:
-            dicts.append(record.as_dict())
-
-        return dicts
-
-        return dict_list
+        return records
 
     ##
     # Resolve a record. This is an internal version of the Resolve API call