- if not found:
- trace("Import: Removing %s %s" % (type, record_hrn))
- record_object = existing_records[(record_hrn, type)]
- sfaImporter.delete_record(record_hrn, type)
-
- # remove stale site_records
- site_records_only = lambda(r_hrn, r_type): r_type == 'authority' and r_hrn != import_auth
- site_records = filter(site_records_only, existing_records.keys())
- for (record_hrn, type) in site_records:
- found = False
- for site in sites:
- site_hrn = import_auth + "." + site['login_base']
- if site_hrn == record_hrn:
- found = True
+ elif type == 'node':
+ login_base = get_leaf(get_authority(record_hrn))
+ nodename = get_leaf(record_hrn)
+ if login_base in sites_dict:
+ site = sites_dict[login_base]
+ for node in nodes:
+ tmp_nodename = node['hostname'].split(".")[0]
+ if tmp_nodename == nodename and \
+ node['site_id'] == site['site_id'] and \
+ node['node_id'] == record['pointer']:
+ found = True
+ break
+ else:
+ continue
+