def take_action(self, parsed_args):
try:
self.app.client.sessions.remove_job(parsed_args.session_id,
parsed_args.job_id)
except Exception as error:
# there is an error coming from the api when a job is removed
# with the following text:
# Additional properties are not allowed
# ('job_event' was unexpected)
# but in reality the job gets removed correctly.
if 'Additional properties are not allowed' in error.message:
pass
else:
raise exceptions.ApiClientException(error.message)
else:
logging.info('Job {0} removed correctly from session {1}'.format(
parsed_args.job_id, parsed_args.session_id))
评论列表
文章目录