# one would think the driver should not need to mess with the SFA db, but..
from sfa.storage.alchemy import dbsession
-from sfa.storage.persistentobjs import RegRecord
+from sfa.storage.model import RegRecord
# used to be used in get_ticket
#from sfa.trust.sfaticket import SfaTicket
self.shell.AddPersonToSite(pointer, login_base)
# What roles should this user have?
- self.shell.AddRoleToPerson('user', pointer)
+ roles=[]
+ if 'roles' in sfa_record:
+ # if specified in xml, but only low-level roles
+ roles = [ role for role in sfa_record['roles'] if role in ['user','tech'] ]
+ # at least user if no other cluse could be found
+ if not roles:
+ roles=['user']
+ for role in roles:
+ self.shell.AddRoleToPerson(role, pointer)
# Add the user's key
if pub_key:
self.shell.AddPersonKey(pointer, {'key_type' : 'ssh', 'key' : pub_key})
pl_record["url"] = sfa_record["url"]
if "description" in sfa_record:
pl_record["description"] = sfa_record["description"]
- if "expires" in sfa_record:
- date = utcparse(sfa_record['expires'])
- expires = datetime_to_epoch(date)
- pl_record["expires"] = expires
+ if "expires" in sfa_record:
+ date = utcparse(sfa_record['expires'])
+ expires = datetime_to_epoch(date)
+ pl_record["expires"] = expires
elif type == "node":
if not "hostname" in pl_record:
# continue
sfa_info = {}
type = record['type']
+ logger.info("fill_record_sfa_info - incoming record typed %s"%type)
if (type == "slice"):
# all slice users are researchers
record['geni_urn'] = hrn_to_urn(record['hrn'], 'slice')
elif (type.startswith("authority")):
record['url'] = None
+ logger.info("fill_record_sfa_info - authority xherex")
if record['pointer'] != -1:
record['PI'] = []
record['operator'] = []
# xxx TODO: URI, LatLong, IP, DNS
elif (type == "user"):
+ logger.info('setting user.email')
sfa_info['email'] = record.get("email", "")
sfa_info['geni_urn'] = hrn_to_urn(record['hrn'], 'user')
sfa_info['geni_certificate'] = record['gid']