Changeset 35aa3ae
- Timestamp:
- Feb 10, 2010 11:26:38 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 8139a48
- Parents:
- 43649f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r43649f1 r35aa3ae 943 943 t = topo.clone() 944 944 945 # Weed out the things we aren't going to instantiate: Segments, portal946 # substrates, and portal interfaces. (The copy in the for loop allows947 # us to delete from e.elements in side the for loop).948 for e in [e for e in t.elements]:949 if isinstance(e, topdl.Segment):950 t.elements.remove(e)951 if isinstance(e, topdl.Computer):952 e.interface = [i for i in e.interface \953 if not i.get_attribute('portal') or \954 i.get_attribute('dragon_vlan')]955 t.substrates = [ s.clone() for s in t.substrates ]956 t.incorporate_elements()957 958 945 # The startcmds for master and slave testbeds 959 946 if master: … … 964 951 node_cmd = self.attrs.get('SlaveNodeStartCmd', 'bin/true') 965 952 966 # Localize the software locations and add startcmds 967 for e in t.elements: 953 # Weed out the things we aren't going to instantiate: Segments, portal 954 # substrates, and portal interfaces. (The copy in the for loop allows 955 # us to delete from e.elements in side the for loop). While we're 956 # touching all the elements, we also adjust paths from the original 957 # testbed to local testbed paths and put the federation commands into 958 # the start commands 959 for e in [e for e in t.elements]: 960 if isinstance(e, topdl.Segment): 961 t.elements.remove(e) 962 # Fix software paths 968 963 for s in getattr(e, 'software', []): 969 964 s.location = re.sub("^.*/", softdir, s.location) 970 965 if isinstance(e, topdl.Computer): 971 if e.get_attribute('portal') :966 if e.get_attribute('portal') and gate_cmd: 972 967 # Portals never have a user-specified start command 973 968 e.set_attribute('startup', gate_cmd) 974 el se:969 elif node_cmd: 975 970 if e.get_attribute('startup'): 976 971 s.set_attribute('startup', "%s \\$USER '%s'" % \ … … 979 974 s.set_attribute('startup', node_cmd) 980 975 976 # Remove portal interfaces that do not connect to DRAGON 977 e.interface = [i for i in e.interface \ 978 if not i.get_attribute('portal') or \ 979 i.get_attribute('dragon_vlan')] 980 981 t.substrates = [ s.clone() for s in t.substrates ] 982 t.incorporate_elements() 981 983 982 984 # Customize the ns2 output for local portal commands and images
Note: See TracChangeset
for help on using the changeset viewer.