raise exceptions in the upgrade process
This commit is contained in:
committed by
Chris MacNaughton
parent
8450216f72
commit
0b92a15da7
@@ -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")
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user