def stop_experiment_parser(opts): """ Parse namespace 'opts' object and execute requested 'stop' command """ user, passwd = auth.get_user_credentials(opts.username, opts.password) api = rest.Api(user, passwd) exp_id = helpers.get_current_experiment(api, opts.experiment_id) return experiment.stop_experiment(api, exp_id)
def stop(self): """If running stop the experiment""" ret = None if self.exp_id is not None: ret = stop_experiment(Api(*self.user_credentials()), self.exp_id) self.exp_id = None return ret
def teardown_exp(self): """ Stop experiment an cleanup stuff maybe """ fabric.utils.puts("teardown_exp %r" % self.exp_id) if self.exp_id is not None: experiment.stop_experiment(self.api, self.exp_id)
def test_experiment_stop(self): """ Test running stop experiment """ experiment.stop_experiment(self.api, 123) self.api.stop_experiment.assert_called_with(123)
def _teardown_exp(api, exp_id): """ Stop experiment an cleanup stuff maybe """ if exp_id is not None: experiment.stop_experiment(api, exp_id)
def abort_experiment(experiment_id): json.loads(experiment.stop_experiment(request, experiment_id))