Changeset 4a53c72


Ignore:
Timestamp:
May 17, 2010 9:08:23 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
5e4025d
Parents:
2e0a952
Message:

A few more places to change the computer name from list to single string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/topdl.py

    r2e0a952 r4a53c72  
    592592
    593593    for eidx, e in enumerate(t.elements):
    594         if e.name: name = e.name[0]
     594        if e.name: name = e.name
    595595        else: name = "unnamed_node%d" % eidx
    596596       
     
    713713        if len(s.interfaces) > 2:
    714714            # Lan
    715             members = [ to_tcl_name("${%s}") % i.element.name[0] \
     715            members = [ to_tcl_name("${%s}") % i.element.name \
    716716                    for i in s.interfaces]
    717717            out += 'set %s [$ns make-lan "%s" %fkb %fms ]\n' % \
     
    725725                if ip:
    726726                    out += "tb-set-ip-lan ${%s} ${%s} %s\n" % \
    727                             (to_tcl_name(e.name[0]), name, ip)
     727                            (to_tcl_name(e.name), name, ip)
    728728                if i.capacity and i.capacity.rate != s.capacity.rate:
    729729                    out += "tb-set-node-lan-bandwidth ${%s} ${%s} %fkb\n" % \
    730                             (to_tcl_name(e.name[0]), name, i.capacity.rate)
     730                            (to_tcl_name(e.name), name, i.capacity.rate)
    731731                if i.latency and i.latency.time != delay:
    732732                    out += "tb-set-node-lan-delay ${%s} ${%s} %fms\n" % \
    733                             (to_tcl_name(e.name[0]), name, i.latency.time)
     733                            (to_tcl_name(e.name), name, i.latency.time)
    734734                iloss = i.get_attribute('loss')
    735735                if loss and iloss != loss :
    736736                    out += "tb-set-node-lan-loss ${%s} ${%s} %f\n" % \
    737                             (to_tcl_name(e.name[0]), name, float(loss))
     737                            (to_tcl_name(e.name), name, float(loss))
    738738            out+= "\n"
    739739        elif len(s.interfaces) == 2:
     
    742742
    743743            out += "set %s [$ns duplex-link ${%s} ${%s} %fkb %fms DropTail]\n" %\
    744                     (name, to_tcl_name(f.element.name[0]),
    745                             to_tcl_name(t.element.name[0]),
     744                    (name, to_tcl_name(f.element.name),
     745                            to_tcl_name(t.element.name),
    746746                            s.capacity.rate, delay)
    747747            if loss:
     
    765765
    766766                    out += "tb-set-link-simplex-params ${%s} ${%s} %fms %fkb %f\n"\
    767                             % (name, to_tcl_name(i.element.name[0]),
     767                            % (name, to_tcl_name(i.element.name),
    768768                                    delay, cap, loss)
    769769                ip = i.get_attribute('ip4_address')
    770770                if ip:
    771771                    out += "tb-set-ip-link ${%s} ${%s} %s\n" % \
    772                             (to_tcl_name(i.element.name[0]), name, ip)
     772                            (to_tcl_name(i.element.name), name, ip)
    773773            out+= "\n"
    774774        for f in filters:
Note: See TracChangeset for help on using the changeset viewer.