Ignore:
Timestamp:
Feb 10, 2010 10:33:53 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
641bb66
Parents:
bbd0039
Message:

Generate configuration files for the new format of gateway nodes. Also insert
the startcmds in this module. The experiment countroller shouldn't be doing
it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    rbbd0039 r0297248  
    852852            rproj, reid = rexp.split("/", 1)
    853853            rdomain = seg.get_attribute('domain')
    854             cfn = "%s/%s.%s.%s%s.gw.conf" % \
    855                     (tmpdir, myname.lower(), leid.lower(),
    856                             lproj.lower(), ldomain.lower())
     854            cfn = "%s/%s.gw.conf" % (tmpdir, myname.lower())
    857855            tunnelconfig = self.attrs.has_key('TunnelCfg')
    858856            try:
    859857                f = open(cfn, "w")
    860                 print >>f, "Active: %s" % active
    861                 print >>f, "TunnelCfg: %s" % tunnelconfig
    862                 print >>f, "BossName: boss"
    863                 print >>f, "FsName: fs"
    864                 print >>f, "EventServerName: event-server%s" % ldomain
    865                 print >>f, "RemoteEventServerName: event-server%s" % rdomain
    866                 print >>f, "SeerControl: control.%s.%s%s" % \
     858                if active == 'True':
     859                    print >>f, "active: %s" % active
     860                    if type in ('control', 'both'):
     861                        print >>f, 'port: remote:139:fs:139'
     862                        print >>f, 'port: remote:7777:boss:7777'
     863                        print >>f, 'port: remote:16606:control:16606'
     864
     865                if tunnelconfig:
     866                    print >>f, "tunnelip: %s" % tunnelconfig
     867                print >>f, "seercontrol: control.%s.%s%s" % \
    867868                        (meid.lower(), mproj.lower(), mdomain)
    868                 print >>f, "Type: %s" % type
    869                 print >>f, "RemoteExperiment: %s" % rexp
    870                 print >>f, "LocalExperiment: %s" % lexp
    871                 print >>f, "RemoteConfigFile: " + \
    872                         "/proj/%s/exp/%s/tmp/%s.%s.%s%s.gw.conf" \
    873                         % (rproj, reid, peer.lower(), reid.lower(),
    874                                 rproj.lower(), rdomain)
    875869                if is_ip:
    876                     print >>f, "Peer: %s" % peer
     870                    print >>f, "peer: %s" % peer
    877871                else:
    878                     print >>f, "Peer: %s.%s.%s%s" % \
     872                    print >>f, "peer: %s.%s.%s%s" % \
    879873                            (peer.lower(), reid.lower(),
    880874                                    rproj.lower(), rdomain)
    881                 print >>f, "RemoteScriptDir: %s" % scriptdir
    882                 print >>f, "Pubkeys: /proj/%s/exp/%s/tmp/%s" % \
     875                print >>f, "ssh_pubkey: /proj/%s/exp/%s/tmp/%s" % \
    883876                        (lproj, leid, pubkey_base)
    884                 print >>f, "Privkeys: /proj/%s/exp/%s/tmp/%s" % \
     877                print >>f, "ssh_privkey: /proj/%s/exp/%s/tmp/%s" % \
    885878                        (lproj, leid, secretkey_base)
    886879                f.close()
     
    919912                            "Cannot write client.conf: %s" %s)
    920913                client_out = True
    921 
    922914
    923915
     
    964956        t.incorporate_elements()
    965957
    966         # Localize the software locations
     958        if master: cmdname = 'MasterConnectorStartCmd'
     959        else:cmdname = 'SlaveConnectorStartCmd'
     960
     961        # Localize the software locations and add
    967962        for e in t.elements:
    968963            for s in getattr(e, 'software', []):
    969964                s.location = re.sub("^.*/", softdir, s.location)
     965            if isinstance(e, topdl.Computer) and e.get_attribute('portal'):
     966                e.set_attribute('startup', self.attrs.get(cmdname))
     967
    970968
    971969        # Customize the ns2 output for local portal commands and images
Note: See TracChangeset for help on using the changeset viewer.