mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Catch exceptions that might pop up when releasing work units
This commit is contained in:
parent
a9636426b8
commit
d79da1ef9f
@ -3071,7 +3071,10 @@ class AWXReceptorJob:
|
||||
finally:
|
||||
# Make sure to always release the work unit if we established it
|
||||
if self.unit_id is not None and settings.RECEPTOR_RELEASE_WORK:
|
||||
receptor_ctl.simple_command(f"work release {self.unit_id}")
|
||||
try:
|
||||
receptor_ctl.simple_command(f"work release {self.unit_id}")
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
|
||||
@property
|
||||
def sign_work(self):
|
||||
@ -3128,7 +3131,7 @@ class AWXReceptorJob:
|
||||
unit_status = receptor_ctl.simple_command(f'work status {self.unit_id}')
|
||||
detail = unit_status.get('Detail', None)
|
||||
state_name = unit_status.get('StateName', None)
|
||||
except RuntimeError as e:
|
||||
except Exception as e:
|
||||
detail = ''
|
||||
state_name = ''
|
||||
logger.exception(e)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user