Changeset ce81d09


Ignore:
Timestamp:
May 26, 2010 7:46:44 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
b3227fd
Parents:
2fd8f8c
Message:

topo using the embedding field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_ftopo.py

    r2fd8f8c rce81d09  
    4545    sys.exit("Error processing RPC: %s" % e)
    4646
     47emap = { }
     48if 'embedding' in resp_dict:
     49    for e in resp_dict['embedding']:
     50        tn = e.get('toponame', None)
     51        if tn:
     52            emap[tn] = ":".join((tn,
     53                ",".join(e.get('physname', [])),e.get('testbed',"")))
     54else:
     55    sys.exit("No embedding")
     56
    4757if 'experimentdescription' in resp_dict and \
    4858        'topdldescription' in resp_dict['experimentdescription']:
    49     top = \
    50         topdl.Topology(\
    51         **resp_dict['experimentdescription']['topdldescription'])
    52 
    53     for e in [ e for e in top.elements \
    54             if isinstance(e, topdl.Computer)]:
    55         hn = e.get_attribute('hostname') or "-"
    56         tb = e.get_attribute('testbed') or "-"
    57         print ":".join((e.name, hn, tb))
     59    top = topdl.Topology(
     60            **resp_dict['experimentdescription']['topdldescription'])
     61    for e in top.elements:
     62        if isinstance(e, topdl.Computer) and e.name in emap:
     63            print emap[e.name]
    5864else:
    59     sys.exit("Badly formatted response!?")
     65    sys.exit("Badly formatted response (no experiment descrption)!?")
Note: See TracChangeset for help on using the changeset viewer.