Ignore:
Timestamp:
Sep 4, 2009 5:04:07 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
Children:
5ae3857
Parents:
f5ae004
Message:

cahekpoint: swaps in again!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/access.py

    rf5ae004 r1da6a23  
    1010from threading import *
    1111import subprocess
     12import signal
    1213import time
    1314
     
    11101111
    11111112        seer_out = False
     1113        client_out = False
    11121114        for p in [ e for e in topo.elements \
    11131115                if isinstance(e, topdl.Computer) and e.get_attribute('portal')]:
     
    11201122            mproj, meid = mexp.split("/", 1)
    11211123            mdomain = e.get_attribute('masterdomain')
     1124            muser = e.get_attribute('masteruser') or 'root'
     1125            smbshare = e.get_attribute('smbshare') or 'USERS'
    11221126            scriptdir = e.get_attribute('scriptdir')
    11231127            active = e.get_attribute('active')
     
    11361140            rdomain = seg.get_attribute('domain')
    11371141            cfn = "%s/%s.%s.%s%s.gw.conf" % \
    1138                     (tmpdir, myname, leid, lproj, ldomain)
     1142                    (tmpdir, myname.lower(), leid.lower(),
     1143                            lproj.lower(), ldomain.lower())
     1144            tunnelconfig = self.attrs.has_key('TunnelCfg')
    11391145            try:
    11401146                f = open(cfn, "w")
    11411147                print >>f, "Active: %s" % active
     1148                print >>f, "TunnelCfg: %s" % tunnelconfig
    11421149                print >>f, "BossName: boss"
    11431150                print >>f, "FsName: fs"
     
    11551162                print >>f, "Peer: %s.%s.%s%s" % \
    11561163                        (peer.lower(), reid.lower(), rproj.lower(), rdomain)
     1164                print >>f, "RemoteScriptDir: %s" % scriptdir
    11571165                print >>f, "Pubkeys: /proj/%s/exp/%s/tmp/%s" % \
    11581166                        (lproj, leid, pubkey_base)
    1159                 print >>f, "Privkey: /proj/%s/exp/%s/tmp/%s" % \
     1167                print >>f, "Privkeys: /proj/%s/exp/%s/tmp/%s" % \
    11601168                        (lproj, leid, secretkey_base)
    11611169                f.close()
     
    11791187                seer_out = True
    11801188
    1181 
    1182     def generate_client_conf(self, user, proj, eid, tmpdir):
    1183         try:
    1184             f = open("%s/client.conf" % tmpdir, "w")
    1185             if self.attrs.has_key('SMBshare'):
    1186                 print >>f, "SMBshare: %s" % self.attrs['SMBshare']
    1187             print >>f, "ProjectUser: %s" % user
    1188             print >>f, "ProjectName: %s" % proj
    1189             print >>f, "ExperimentID: %s/%s" % (proj, eid)
    1190             f.close()
    1191         except IOError, e:
    1192             raise service_error(service_error.internal,
    1193                     "Cannot write client.conf: %s" %s)
     1189            if not client_out and type in ('control', 'both'):
     1190                try:
     1191                    f = open("%s/client.conf" % tmpdir, "w")
     1192                    print >>f, "ControlGateway: %s.%s.%s%s" % \
     1193                        (myname.lower(), leid.lower(), lproj.lower(),
     1194                                ldomain.lower())
     1195                    print >>f, "SMBshare: %s" % smbshare
     1196                    print >>f, "ProjectUser: %s" % muser
     1197                    print >>f, "ProjectName: %s" % mproj
     1198                    print >>f, "ExperimentID: %s/%s" % (mproj, meid)
     1199                    f.close()
     1200                except IOError, e:
     1201                    raise service_error(service_error.internal,
     1202                            "Cannot write client.conf: %s" %s)
     1203                client_out = True
     1204
     1205
    11941206
    11951207    def generate_ns2(self, topo, expfn, softdir, master):
     
    12141226                s.location = re.sub("^.*/", softdir, s.location)
    12151227
    1216 
    12171228        # Customize the ns2 output for local portal commands and images
    12181229        filters = []
     
    13401351        self.generate_ns2(topo, expfile,
    13411352                "/proj/%s/software/%s/" % (proj, ename), master)
    1342         self.generate_client_conf(user, proj, ename, tmpdir)
    13431353        starter = self.start_segment(keyfile=self.ssh_privkey_file, debug=False)
    13441354        starter(self, ename, proj, user, expfile, tmpdir)
Note: See TracChangeset for help on using the changeset viewer.