raise exceptions in the upgrade process

This commit is contained in:
Chris MacNaughton
2020-03-18 10:49:29 +01:00
committed by Chris MacNaughton
parent 8450216f72
commit 0b92a15da7
3 changed files with 6 additions and 3 deletions
@@ -328,7 +328,7 @@ class ParallelSeriesUpgradeTest(unittest.TestCase):
post_upgrade_functions=post_upgrade_functions))
asyncio.get_event_loop().run_until_complete(
asyncio.gather(*upgrade_group, return_exceptions=True))
asyncio.gather(*upgrade_group))
if "rabbitmq-server" in group:
logging.info(
"Running complete-cluster-series-upgrade action on leader")
+3 -1
View File
@@ -247,7 +247,7 @@ def run_via_ssh(unit_name, cmd):
logging.warn(e)
async def async_run_via_ssh(unit_name, cmd):
async def async_run_via_ssh(unit_name, cmd, raise_exceptions=False):
"""Run command on unit via ssh.
For executing commands on units when the juju agent is down.
@@ -267,6 +267,8 @@ async def async_run_via_ssh(unit_name, cmd):
except subprocess.CalledProcessError as e:
logging.warn("Failed command {} on {}".format(cmd, unit_name))
logging.warn(e)
if raise_exceptions:
raise e
def check_commands_on_units(commands, units):
+2 -1
View File
@@ -744,5 +744,6 @@ async def async_do_release_upgrade(unit_name):
await os_utils.async_run_via_ssh(
unit_name,
'DEBIAN_FRONTEND=noninteractive '
'do-release-upgrade -f DistUpgradeViewNonInteractive')
'do-release-upgrade -f DistUpgradeViewNonInteractive',
raise_exceptions=True)