Changeset a74ea78


Ignore:
Timestamp:
Jul 24, 2009 7:10:29 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
281c0ca
Parents:
bd3e314
Message:

Properly avoid terminating a starting experiment (this will have to get an
override) and be more conservative when starting ssh commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    rbd3e314 ra74ea78  
    530530        def ssh_cmd(self, user, host, cmd, wname=None, timeout=None):
    531531            """
    532             Run a remote command on host as user.  If debug is set, the action is
    533             only logged.
     532            Run a remote command on host as user.  If debug is set, the action
     533            is only logged.  Commands are run without stdin, to avoid stray
     534            SIGTTINs.
    534535            """
    535             sh_str = ("%s -o 'IdentitiesOnly yes' -o " + \
     536            sh_str = ("%s -n -o 'IdentitiesOnly yes' -o " + \
    536537                    "'StrictHostKeyChecking yes' -i %s %s@%s %s") % \
    537538                    (self.ssh_exec, self.ssh_privkey_file,
     
    20332034                    {'localname' : eid }, { 'fedid': copy.copy(expid) }
    20342035                ],
    2035                 'experimentStatus': 'started',
     2036                'experimentStatus': 'starting',
    20362037                'experimentAccess': { 'X509' : expcert }
    20372038            }
     
    22182219                rv['allocationLog'] = "".join(rv['log'])
    22192220                del rv['log']
     2221            else:
     2222                rv['allocationLog'] = ""
    22202223
    22212224            if rv['experimentStatus'] != 'active':
     
    22662269
    22672270            # First make sure that the experiment creation is complete.
    2268             if fed_exp.has_key('experimentStatus'):
    2269                 if fed_exp['experimentStatus'] == 'started':
     2271            status = fed_exp.get('experimentStatus', None)
     2272            if status:
     2273                if status == 'starting':
    22702274                    self.state_lock.release()
    22712275                    raise service_error(service_error.partial,
     
    23302334            thread_pool.wait_for_all_done()
    23312335
    2332             # release the allocations
    2333             for tb in tbparams.keys():
    2334                 self.release_access(tb, tbparams[tb]['aid'])
     2336            # release the allocations (failed experiments have done this
     2337            # already)
     2338            if status != 'failed':
     2339                for tb in tbparams.keys():
     2340                    self.release_access(tb, tbparams[tb]['aid'])
    23352341
    23362342            # Remove the terminated experiment
Note: See TracChangeset for help on using the changeset viewer.