Changeset 4d68ba6


Ignore:
Timestamp:
Apr 13, 2012 3:10:58 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, master
Children:
66795cf0
Parents:
c0f409a
Message:

Do not add a startcommand to non-federated experiments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    rc0f409a r4d68ba6  
    408408                return e.name not in self.nodes
    409409
     410        def have_portals(top):
     411            '''
     412            Return true if the topology has a portal node
     413            '''
     414            # The else is on the for
     415            for e in top.elements:
     416                if isinstance(e, topdl.Computer) and e.get_attribute('portal'):
     417                    return True
     418            else:
     419                return False
     420
     421
    410422        # Main line of generate_ns2
    411423        t = topo.clone()
     
    443455        # testbed to local testbed paths and put the federation commands into
    444456        # the start commands
     457        local = len(dragon_map) == 0 and not have_portals(t)
     458        if local: routing = 'Static'
     459        else: routing = 'Manual'
     460
     461        self.log.debug("Local: %s", local)
    445462        for e in [e for e in t.elements]:
    446463            if isinstance(e, topdl.Segment):
     
    453470                    # Portals never have a user-specified start command
    454471                    e.set_attribute('startup', self.portal_startcommand)
    455                 elif self.node_startcommand:
     472                elif not local and self.node_startcommand:
    456473                    if e.get_attribute('startup'):
    457474                        e.set_attribute('startup', "%s \\$USER '%s'" % \
     
    494511
    495512        # Convert to ns and write it out
    496         expfile = topdl.topology_to_ns2(t, filters)
     513        expfile = topdl.topology_to_ns2(t, filters, routing=routing)
    497514        try:
    498515            f = open(expfn, "w")
Note: See TracChangeset for help on using the changeset viewer.