diff --git a/apps/ops/ansible/runner.py b/apps/ops/ansible/runner.py index ac83d0d8e..03aec1787 100644 --- a/apps/ops/ansible/runner.py +++ b/apps/ops/ansible/runner.py @@ -32,7 +32,8 @@ class AdHocRunner: if self.module not in self.cmd_modules_choices: return if self.module_args and self.module_args.split()[0] in settings.SECURITY_COMMAND_BLACKLIST: - raise CommandInBlackListException("command not allowed:{}".format(self.module_args.split()[0])) + raise CommandInBlackListException( + "Command is rejected by black list: {}".format(self.module_args.split()[0])) def run(self, verbosity=0, **kwargs): self.check_module() diff --git a/apps/ops/models/job.py b/apps/ops/models/job.py index 932a948b0..b655fc095 100644 --- a/apps/ops/models/job.py +++ b/apps/ops/models/job.py @@ -451,7 +451,7 @@ class JobExecution(JMSOrgBaseModel): self.set_result(cb) return cb except CommandInBlackListException as e: - print("command is rejected by black list: {}".format(e)) + print(e) except Exception as e: logging.error(e, exc_info=True) self.set_error(e)