mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Handle quota exceeded in Container Groups v2
This commit is contained in:
@@ -1451,6 +1451,9 @@ class BaseTask(object):
|
|||||||
receptor_job = AWXReceptorJob(self, params)
|
receptor_job = AWXReceptorJob(self, params)
|
||||||
res = receptor_job.run()
|
res = receptor_job.run()
|
||||||
|
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
|
||||||
status = res.status
|
status = res.status
|
||||||
rc = res.rc
|
rc = res.rc
|
||||||
|
|
||||||
@@ -3112,7 +3115,15 @@ class AWXReceptorJob:
|
|||||||
elif res.status == 'error':
|
elif res.status == 'error':
|
||||||
# TODO: There should be a more efficient way of getting this information
|
# TODO: There should be a more efficient way of getting this information
|
||||||
receptor_work_list = receptor_ctl.simple_command("work list")
|
receptor_work_list = receptor_ctl.simple_command("work list")
|
||||||
raise RuntimeError(receptor_work_list[self.unit_id]['Detail'])
|
detail = receptor_work_list[self.unit_id]['Detail']
|
||||||
|
if 'exceeded quota' in detail:
|
||||||
|
logger.warn(detail)
|
||||||
|
log_name = self.task.instance.log_format
|
||||||
|
logger.warn(f"Could not launch pod for {log_name}. Exceeded quota.")
|
||||||
|
self.task.update_model(self.task.instance.pk, status='pending')
|
||||||
|
return
|
||||||
|
|
||||||
|
raise RuntimeError(detail)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user