diff --git a/unit_tests/utilities/test_zaza_utilities_generic.py b/unit_tests/utilities/test_zaza_utilities_generic.py index 038d53e0..3274c92d 100644 --- a/unit_tests/utilities/test_zaza_utilities_generic.py +++ b/unit_tests/utilities/test_zaza_utilities_generic.py @@ -213,7 +213,8 @@ def test_juju_reboot(self): generic_utils.juju_reboot(_unit) self.subprocess.check_call.assert_called_once_with( ['juju', 'ssh', _unit, - f'sudo juju-run -u {_unit} "juju-reboot --now"']) + f'sudo juju-run -u {_unit} "juju-reboot --now" || ' + f'sudo juju-exec -u {_unit} "juju-reboot --now"']) def test_run_via_ssh(self): _unit = "app/2" diff --git a/zaza/utilities/generic.py b/zaza/utilities/generic.py index 4addec67..60afbf17 100644 --- a/zaza/utilities/generic.py +++ b/zaza/utilities/generic.py @@ -519,7 +519,9 @@ def juju_reboot(unit_name): with update-status hooks causing intermittent CI failures). """ cmd = ['juju', 'ssh', unit_name, - 'sudo juju-run -u {} "juju-reboot --now"'.format(unit_name)] + 'sudo juju-run -u {} "juju-reboot --now" || ' + 'sudo juju-exec -u {} "juju-reboot --now"' + .format(unit_name, unit_name)] try: subprocess.check_call(cmd) except subprocess.CalledProcessError as e: