Changeset 2fd8f8c


Ignore:
Timestamp:
May 26, 2010 6:42:48 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
ce81d09
Parents:
f432e51
Message:

ftopo improvements

Location:
fedd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_info.py

    rf432e51 r2fd8f8c  
    1717                action="append", type="choice",
    1818                choices=("id", "experimentdescription", "federant", "vtopo",
    19                     "vis", "log", "status"),
     19                    "vis", "log", "status", "embedding"),
    2020                help="data to extract")
    2121       
     
    4848formatter = info_format()
    4949for d in opts.data:
    50     formatter(resp_dict, d)
     50    try:
     51        formatter(resp_dict, d)
     52    except RuntimeError, e:
     53        print >>sys.stderr, "Warning: %s" % e
  • fedd/federation/client_lib.py

    rf432e51 r2fd8f8c  
    204204                'status': 'experimentStatus',
    205205                'log': 'allocationLog',
     206                'embedding': 'embedding',
    206207            }
    207208        self.formatter = {
     
    213214                'status': self.print_string,
    214215                'log': self.print_string,
     216                'embedding':  self.print_xml,
    215217            }
    216218
  • fedd/federation/experiment_control.py

    rf432e51 r2fd8f8c  
    10161016            self.response = None
    10171017            self.node = { }
    1018 
    1019         #def make_map(self, resp):
    1020             #if 'segmentdescription' in resp and \
    1021                     #'topdldescription' in resp['segmentdescription']:
    1022                 #top = topdl.Topology(\
    1023                         #**resp['segmentdescription']['topdldescription'])
    1024                 #for e in [e for e in top.elements \
    1025                         #if isinstance(e, topdl.Computer)]:
    1026                     #hn = e.get_attribute('hostname')
    1027                     #if hn:
    1028                         #for n in e.name:
    1029                             #self.node[n] = hn
    10301018
    10311019        def make_map(self, resp):
     
    12281216            # Walk through the successes and gather the virtual to physical
    12291217            # mapping.
    1230             node = { }
     1218            embedding = [ ]
    12311219            for s in starters:
    1232                 node.update(s.node)
    1233             # Assign the mapping as a hostname attribute
    1234             for e in [ e for e in top.elements \
    1235                     if isinstance(e, topdl.Computer)]:
    1236                 for n in e.name:
    1237                     if n in node:
    1238                         e.set_attribute('hostname', node[n])
     1220                for k, v in s.node.items():
     1221                    embedding.append({
     1222                        'toponame': k,
     1223                        'physname': [ v],
     1224                        'testbed': s.testbed
     1225                        })
    12391226            log.info("[start_segment]: Experiment %s active" % eid)
    12401227
     
    12581245        self.state[eid]['experimentdescription']['topdldescription'] = \
    12591246                top.to_dict()
     1247        self.state[eid]['embedding'] = embedding
    12601248        if self.state_filename: self.write_state()
    12611249        self.state_lock.release()
Note: See TracChangeset for help on using the changeset viewer.