Changeset 58e5a4f for fedd


Ignore:
Timestamp:
Oct 7, 2011 5:30:13 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
451fb96
Parents:
05c41f5 (diff), 1fed67b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of git://fedd.deterlab.net/fedd

Location:
fedd/federation
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    r1fed67b r58e5a4f  
    933933        user = None
    934934        alloc_log = None
     935        nonce_experiment = False
    935936        vchars_re = '[^' + string.ascii_letters + string.digits  + '-]'
    936937
     
    973974            for i in range(0,5):
    974975                ename += random.choice(string.ascii_letters)
     976            nonce_experiment = True
    975977            self.log.warn("No experiment name or suggestion too long: " + \
    976978                    "picked one randomly: %s" % ename)
     
    988990            user = self.allocation[aid].get('user', None)
    989991            self.allocation[aid]['experiment'] = ename
     992            self.allocation[aid]['nonce'] = nonce_experiment
    990993            self.allocation[aid]['log'] = [ ]
    991994            # Create a logger that logs to the experiment's state object as
     
    11621165            user = self.allocation[aid].get('user', None)
    11631166            ename = self.allocation[aid].get('experiment', None)
     1167            nonce = self.allocation[aid].get('nonce', False)
    11641168        else:
    11651169            proj = None
    11661170            user = None
    11671171            ename = None
     1172            nonce = False
    11681173        self.state_lock.release()
    11691174
     
    11831188        stopper = self.stop_segment(keyfile=self.ssh_privkey_file,
    11841189                debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert)
    1185         stopper(self, user, proj, ename, gid)
     1190        stopper(self, user, proj, ename, gid, nonce)
    11861191        return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
  • fedd/federation/emulab_segment.py

    r1fed67b r58e5a4f  
    156156        return code == 0
    157157
     158    def terminate_exp(self, pid, eid, wait=True):
     159        """
     160        Completely terminate experiment
     161        """
     162        if self.debug:
     163            if self.log:
     164                self.log.info("[swap_exp]: (debug) terminate %s" %  eid)
     165            return True
     166        else:
     167            if self.log:
     168                self.log.info("[swap_exp]: Terminating %s" % (eid)
     169            params = {
     170                    'proj': pid,
     171                    'exp': eid,
     172                    'wait': wait,
     173                    }
     174            code, value = self.emulab_call('experiment.endexp', params)
     175
     176            if self.log:
     177                if code == 0: self.log.info('[swap_exp]: Terminate succeeded')
     178                else: self.log.error('[swap_exp]: Terminate failed: %s' % value)
     179
     180        return code == 0
     181
    158182    def modify_exp(self, pid, eid, tcl, wait=True):
    159183        if self.debug:
  • fedd/federation/experiment_control.py

    r05c41f5 r58e5a4f  
    789789
    790790        os.remove(dotname)
    791         if rv == 0 : return vis
     791        # XXX: graphviz seems to use low return codes for warnings, like
     792        # "couldn't find font"
     793        if rv < 2 : return vis
    792794        else: return None
    793795
  • fedd/federation/local_emulab_segment.py

    r1fed67b r58e5a4f  
    103103        emulab_segment.__init__(self, boss=boss, cert=cert)
    104104
    105     def __call__(self, parent, user, pid, eid, gid=None):
     105    def __call__(self, parent, user, pid, eid, gid=None, terminate=False):
    106106        """
    107107        Stop a sub experiment by calling swapexp on the federant
     
    114114            self.cmd_with_timeout("rm -rf /proj/%s/software/%s" % (pid, eid))
    115115            rv = self.swap_exp(pid, eid, 'out')
     116            if terminate:
     117                rv = self.terminate_exp(pid, eid)
    116118        except self.cmd_timeout:
    117119            rv = False
  • fedd/federation/proxy_emulab_segment.py

    r1fed67b r58e5a4f  
    330330        proxy_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    331331
    332     def __call__(self, parent, user, pid, eid, gid=None):
     332    def __call__(self, parent, user, pid, eid, gid=None, terminate=False):
    333333        """
    334334        Stop a sub experiment by calling swapexp on the federant
     
    343343            rv = self.ssh_cmd(user, host,
    344344                    "/usr/testbed/bin/swapexp -w %s %s out" % (pid, eid))
     345            if terminate:
     346                rv = self.ssh_cmd(user, host,
     347                        "/usr/testbed/bin/endexp -w %s %s" % (pid, eid))
    345348        except self.ssh_cmd_timeout:
    346349            rv = False
Note: See TracChangeset for help on using the changeset viewer.