mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fixes a weird udf scenario (#33681)
The situation happened where in udf it stopped provisioning correctly. Seems like the best resolution is to restart asm.
This commit is contained in:
@@ -344,6 +344,7 @@ class ModuleManager(object):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
nops = 0
|
nops = 0
|
||||||
|
restarted_asm = False
|
||||||
while nops < 3:
|
while nops < 3:
|
||||||
try:
|
try:
|
||||||
policies = self.client.api.tm.asm.policies_s.get_collection()
|
policies = self.client.api.tm.asm.policies_s.get_collection()
|
||||||
@@ -352,9 +353,23 @@ class ModuleManager(object):
|
|||||||
else:
|
else:
|
||||||
nops = 0
|
nops = 0
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
pass
|
if not restarted_asm:
|
||||||
|
self._restart_asm()
|
||||||
|
restarted_asm = True
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
def _restart_asm(self):
|
||||||
|
try:
|
||||||
|
self.client.api.tm.util.bash.exec_cmd(
|
||||||
|
'run',
|
||||||
|
utilCmdArgs='-c "bigstart restart asm"'
|
||||||
|
)
|
||||||
|
time.sleep(60)
|
||||||
|
return True
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return None
|
||||||
|
|
||||||
def _get_last_reboot(self):
|
def _get_last_reboot(self):
|
||||||
try:
|
try:
|
||||||
output = self.client.api.tm.util.bash.exec_cmd(
|
output = self.client.api.tm.util.bash.exec_cmd(
|
||||||
|
|||||||
Reference in New Issue
Block a user