1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02: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:
Tim Rupp 2017-12-07 08:47:35 -08:00 committed by GitHub
parent 31e3b8197f
commit a0dc776f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -344,6 +344,7 @@ class ModuleManager(object):
:return:
"""
nops = 0
restarted_asm = False
while nops < 3:
try:
policies = self.client.api.tm.asm.policies_s.get_collection()
@ -352,9 +353,23 @@ class ModuleManager(object):
else:
nops = 0
except Exception as ex:
pass
if not restarted_asm:
self._restart_asm()
restarted_asm = True
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):
try:
output = self.client.api.tm.util.bash.exec_cmd(