git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge Master in geni-v3 conflict resolution
[sfa.git]
/
sfa
/
managers
/
registry_manager.py
diff --git
a/sfa/managers/registry_manager.py
b/sfa/managers/registry_manager.py
index
dfc5a74
..
c24c1f5
100644
(file)
--- a/
sfa/managers/registry_manager.py
+++ b/
sfa/managers/registry_manager.py
@@
-46,7
+46,13
@@
class RegistryManager:
hrn = urn_to_hrn(xrn)[0]
else:
hrn, type = urn_to_hrn(xrn)
hrn = urn_to_hrn(xrn)[0]
else:
hrn, type = urn_to_hrn(xrn)
-
+
+ # Slivers don't have credentials but users should be able to
+ # specify a sliver xrn and receive the slice's credential
+ if type == 'sliver' or '-' in Xrn(hrn).leaf:
+ slice_xrn = self.driver.sliver_to_slice_xrn(hrn)
+ hrn = slice_xrn.hrn
+
# Is this a root or sub authority
auth_hrn = api.auth.get_authority(hrn)
if not auth_hrn or hrn == api.config.SFA_INTERFACE_HRN:
# Is this a root or sub authority
auth_hrn = api.auth.get_authority(hrn)
if not auth_hrn or hrn == api.config.SFA_INTERFACE_HRN:
@@
-155,7
+161,7
@@
class RegistryManager:
local_records = dbsession.query(RegRecord).filter(RegRecord.hrn.in_(local_hrns))
if type:
local_records = local_records.filter_by(type=type)
local_records = dbsession.query(RegRecord).filter(RegRecord.hrn.in_(local_hrns))
if type:
local_records = local_records.filter_by(type=type)
- local_records=local_records.all()
+ local_records=local_records.all()
for local_record in local_records:
augment_with_sfa_builtins (local_record)
for local_record in local_records:
augment_with_sfa_builtins (local_record)
@@
-177,6
+183,7
@@
class RegistryManager:
record.url=neighbour_dict[hrn].get_url()
return
for record in local_records: solve_neighbour_url (record)
record.url=neighbour_dict[hrn].get_url()
return
for record in local_records: solve_neighbour_url (record)
+
# convert local record objects to dicts for xmlrpc
# xxx somehow here calling dict(record) issues a weird error
# however record.todict() seems to work fine
# convert local record objects to dicts for xmlrpc
# xxx somehow here calling dict(record) issues a weird error
# however record.todict() seems to work fine
@@
-399,12
+406,16
@@
class RegistryManager:
# anyway the driver should receive an object
# (and then extract __dict__ itself if needed)
print "DO NOT REMOVE ME before driver.update, record=%s"%record
# anyway the driver should receive an object
# (and then extract __dict__ itself if needed)
print "DO NOT REMOVE ME before driver.update, record=%s"%record
- (pointer, new_key_pointer) = self.driver.update (record.__dict__, new_record.__dict__, hrn, new_key)
- if new_key and new_key_pointer:
+ new_key_pointer = -1
+ try:
+ (pointer, new_key_pointer) = self.driver.update (record.__dict__, new_record.__dict__, hrn, new_key)
+ except:
+ pass
+ if new_key and new_key_pointer:
record.reg_keys=[ RegKey (new_key, new_key_pointer)]
record.gid = gid
record.reg_keys=[ RegKey (new_key, new_key_pointer)]
record.gid = gid
- dbsession.commit()
;
+ dbsession.commit()
# update membership for researchers, pis, owners, operators
self.update_driver_relations (record, new_record)
# update membership for researchers, pis, owners, operators
self.update_driver_relations (record, new_record)