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