Changeset 4afcfc4
- Timestamp:
- Dec 9, 2009 3:53:14 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- c122b0c
- Parents:
- bde2217
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
rbde2217 r4afcfc4 498 498 msg = { 499 499 'allocID': alloc_id, 500 'emulab': { 501 'domain': self.domain, 502 'boss': self.boss, 503 'ops': self.ops, 504 'fileServer': self.fileserver, 505 'eventServer': self.eventserver, 506 'project': ap['project'] 507 }, 500 'fedAttr': [ 501 { 'attribute': 'domain', 'value': self.domain } , 502 { 'attribute': 'project', 'value': 503 ap['project'].get('name', {}).get('localname', "???") }, 504 ] 508 505 } 509 506 if len(self.attrs) > 0: 510 msg[' emulab']['fedAttr'] = \507 msg['fedAttr'].extend( 511 508 [ { 'attribute': x, 'value' : y } \ 512 for x,y in self.attrs.iteritems()] 509 for x,y in self.attrs.iteritems()]) 513 510 return msg 514 511 -
fedd/federation/experiment_control.py
rbde2217 r4afcfc4 816 816 "Access denied by %s (%s)" % (tb, uri)) 817 817 818 if r.has_key('emulab'): 819 e = r['emulab'] 820 p = e['project'] 821 tbparam[tb] = { 822 "boss": e['boss'], 823 "host": e['ops'], 824 "domain": e['domain'], 825 "fs": e['fileServer'], 826 "eventserver": e['eventServer'], 827 "project": unpack_id(p['name']), 828 "emulab" : e, 829 "allocID" : r['allocID'], 830 "uri": uri, 831 } 832 # Make the testbed name be the label the user applied 833 p['testbed'] = {'localname': tb } 834 835 for u in p['user']: 836 role = u.get('role', None) 837 if role == 'experimentCreation': 838 tbparam[tb]['user'] = unpack_id(u['userID']) 839 break 840 else: 841 raise service_error(service_error.internal, 842 "No createExperimentUser from %s" %tb) 843 # Add attributes to parameter space. We don't allow attributes to 844 # overlay any parameters already installed. 845 for a in e['fedAttr']: 846 try: 847 if a['attribute'] and \ 848 isinstance(a['attribute'], basestring)\ 849 and not tbparam[tb].has_key(a['attribute'].lower()): 850 tbparam[tb][a['attribute'].lower()] = a['value'] 851 except KeyError: 852 self.log.error("Bad attribute in response: %s" % a) 853 else: 854 tbparam[tb] = { 818 tbparam[tb] = { 855 819 "allocID" : r['allocID'], 856 820 "uri": uri, 857 } 821 } 822 823 # Add attributes to parameter space. We don't allow attributes to 824 # overlay any parameters already installed. 825 for a in r['fedAttr']: 826 try: 827 if a['attribute'] and \ 828 isinstance(a['attribute'], basestring)\ 829 and not tbparam[tb].has_key(a['attribute'].lower()): 830 tbparam[tb][a['attribute'].lower()] = a['value'] 831 except KeyError: 832 self.log.error("Bad attribute in response: %s" % a) 858 833 859 834 def release_access(self, tb, aid, uri=None): … … 1989 1964 self.state_lock.acquire() 1990 1965 if self.state.has_key(key): 1966 self.state[key]['experimentStatus'] = "starting" 1991 1967 for e in self.state[key].get('experimentID',[]): 1992 1968 if not expid and e.has_key('fedid'):
Note: See TracChangeset
for help on using the changeset viewer.