def test_cleanup(self, runner): paunch.cleanup(['foo', 'bar'], 'tester') runner.assert_called_once_with('tester', cont_cmd='docker', log=mock.ANY) runner.return_value.delete_missing_configs.assert_called_once_with( ['foo', 'bar']) runner.return_value.rename_containers.assert_called_once_with()
def take_action(self, parsed_args): (self.log, log_file, log_level) = \ utils.common.configure_logging_from_args(__name__, self.app_args) paunch.cleanup(parsed_args.config_id, managed_by=parsed_args.managed_by, cont_cmd=parsed_args.default_runtime, log_level=log_level, log_file=log_file)
def paunch_cleanup(self): self.results['action'].append('Cleaning-up config_id(s) ' '%s' % self.config_id) p.cleanup(self.config_id, managed_by=self.managed_by, cont_cmd=self.container_cli, log_level=self.log_level, log_file=self.log_file) self.module.exit_json(**self.results)
def take_action(self, parsed_args): # takes 1, or 2 if --verbose, or 4 - 5 if --debug log_level = (self.app_args.verbose_level + int(self.app_args.debug) * 3) log_file = self.app_args.log_file or constants.LOG_FILE self.log = utils.common.configure_logging(__name__, log_level, log_file) paunch.cleanup(parsed_args.config_id, managed_by=parsed_args.managed_by, cont_cmd=parsed_args.default_runtime, log_level=log_level, log_file=log_file)
def take_action(self, parsed_args): paunch.cleanup(parsed_args.config_id, managed_by=parsed_args.managed_by)