+def import_slice(person):
+
+ hrn = person['hrn']+'_slice'
+ pkey = Keypair(create=True)
+ urn = hrn_to_urn(hrn, 'slice')
+ gid = AuthHierarchy.create_gid(urn, create_uuid(), pkey)
+ slice_record= SfaRecord(hrn=hrn, gid=gid, type="slice", pointer=-1)
+ slice_record['authority'] = get_authority(slice_record['hrn'])
+
+ extime = datetime.datetime.utcnow()
+ slice_record['date_created'] = int(time.mktime(extime.timetuple()))
+
+ print>>sys.stderr, " \r\n \t slab-import : slice record %s " %(slice_record['hrn'])
+ existing_records = table.find({'hrn': slice_record['hrn'], 'type': 'slice'})
+ if not existing_records:
+ print>>sys.stderr, " \r\n \t slab-import : slice record %s inserted" %(slice_record['hrn'])
+ table.insert(slice_record)
+ else:
+ print>>sys.stderr, " \r\n \t slab-import : slice record %s updated" %(slice_record['hrn'])
+ existing_record = existing_records[0]
+ slice_record['record_id'] = existing_record['record_id']
+ table.update(slice_record)