Changeset a2ca699 for fedd/federation/emulab_access.py
- Timestamp:
- Mar 10, 2014 4:25:32 PM (10 years ago)
- Branches:
- master
- Children:
- 8fbef04
- Parents:
- 4a02274 (diff), e1ed2a7b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
re1ed2a7b ra2ca699 104 104 self.info_segment = emulab_segment.info_segment 105 105 self.operation_segment = emulab_segment.operation_segment 106 self.exports_segment = emulab_segment.exports_segment 106 107 107 108 self.restricted = [ ] … … 563 564 def export_store_info(self, cf, proj, ename, connInfo): 564 565 """ 565 For the export requests in the connection info, install the peer names 566 at the experiment controller via SetValue calls. 566 For the export requests in the connection info, send out teh SetValue 567 calls for parameters initialized by the segment's export_segment 568 object. Values are all in the connInfo parameter's value fields. 567 569 """ 568 570 569 571 for c in connInfo: 570 for p in [ p for p in c.get('parameter', []) \ 571 if p.get('type', '') == 'output']: 572 573 if p.get('name', '') == 'peer': 574 k = p.get('key', None) 575 surl = p.get('store', None) 576 if surl : 577 if self.nat_portal: 578 value = self.nat_portal 579 elif k and k.index('/') != -1: 580 value = "%s.%s.%s%s" % \ 581 (k[k.index('/')+1:], ename, proj, self.domain) 582 else: 583 self.log.error("Bad export request: %s" % p) 584 continue 585 self.log.debug("Setting %s to %s on %s" % \ 586 (k, value, surl)) 587 req = { 'name': k, 'value': value } 588 self.call_SetValue(surl, req, cf) 589 else: 590 self.log.error("Bad export request: %s" % p) 591 elif p.get('name', '') == 'ssh_port': 592 k = p.get('key', None) 593 surl = p.get('store', None) 594 if surl and k: 595 req = { 'name': k, 'value': self.ssh_port } 596 self.log.debug("Setting %s to %s on %s" % \ 597 (k, self.ssh_port, surl)) 598 self.call_SetValue(surl, req, cf) 599 else: 600 self.log.error("Bad export request: %s" % p) 601 else: 602 self.log.error("Unknown export parameter: %s" % \ 572 for p in c.get('parameter', []): 573 # Ignore non-output parameters 574 if p.get('type', '') != 'output': 575 continue 576 # Sanity check store, key and value 577 surl = p.get('store', None) 578 key = p.get('key', None) 579 value = p.get('value', None) 580 if surl is None: 581 self.log.error("Export parameter without store: %s" % \ 603 582 p.get('name')) 604 583 continue 584 if key is None: 585 self.log.error("Export parameter without key: %s" % \ 586 p.get('name')) 587 continue 588 if value is None: 589 self.log.error("Unknown (unset) export parameter: %s" % \ 590 p.get('name')) 591 continue 592 # Set the store value 593 req = { 'name': key, 'value': value } 594 self.call_SetValue(surl, req, cf) 605 595 606 596 def add_seer_node(self, topo, name, startup): … … 984 974 self.configure_seer_services(services, topo, softdir) 985 975 # Get and send synch store variables 976 exporter = self.exports_segment(keyfile=self.ssh_privkey_file, 977 debug=self.create_debug, log=alloc_log, boss=self.boss, 978 ops=self.ops, cert=xmlrpc_cert) 979 exporter(self, ename, proj, user, connInfo, tmpdir, gid) 986 980 self.export_store_info(certfile, proj, ename, connInfo) 987 981 self.import_store_info(certfile, connInfo)
Note: See TracChangeset
for help on using the changeset viewer.