Merge branch 'master' into senslab2
[sfa.git] / sfa / importer / nitosimporter.py
index 12dedcc..080417d 100644 (file)
@@ -120,11 +120,11 @@ class NitosImporter:
         # create a dict user_id -> [ (nitos)keys ]
         keys_by_user_id = dict ( [ ( user['user_id'], user['keys']) for user in users ] ) 
         # Get all nitos nodes  
-        nodes = shell.getNodes()
+        nodes = shell.getNodes({}, [])
         # create hash by node_id
         nodes_by_id = dict ( [ (node['node_id'], node) for node in nodes ] )
         # Get all nitos slices
-        slices = shell.getSlices()
+        slices = shell.getSlices({}, [])
         # create hash by slice_id
         slices_by_id = dict ( [ (slice['slice_id'], slice) for slice in slices ] )
 
@@ -164,7 +164,7 @@ class NitosImporter:
             for node in nodes:
                 site_auth = get_authority(site_hrn)
                 site_name = site['name']
-                node_hrn =  hostname_to_hrn(site_auth, site_name, node['name'])
+                node_hrn =  hostname_to_hrn(site_auth, site_name, node['hostname'])
                 # xxx this sounds suspicious
                 if len(node_hrn) > 64: node_hrn = node_hrn[:64]
                 node_record = self.locate_by_type_hrn ( 'node', node_hrn )
@@ -186,6 +186,7 @@ class NitosImporter:
                 else:
                     # xxx update the record ...
                     pass
+                
                 node_record.stale=False
 
 
@@ -293,7 +294,7 @@ class NitosImporter:
                     pass
                 # record current users affiliated with the slice
                 slice_record.reg_researchers = \
-                      [ self.locate_by_type_pointer ('user',int(user_id)) for user_id in slice['user_id'] ]
+                      [ self.locate_by_type_pointer ('user',int(user_id)) for user_id in slice['user_ids'] ]
                 dbsession.commit()
                 slice_record.stale=False