Skip to content

Commit 2013630

Browse files
authored
Merge pull request #685 from mkalcok/caracal-juju-reboot
[stable/caracal] utilities: Fix juju_reboot for 3.x.
2 parents 4b786cb + def65cc commit 2013630

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

unit_tests/utilities/test_zaza_utilities_generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def test_juju_reboot(self):
213213
generic_utils.juju_reboot(_unit)
214214
self.subprocess.check_call.assert_called_once_with(
215215
['juju', 'ssh', _unit,
216-
f'sudo juju-run -u {_unit} "juju-reboot --now"'])
216+
f'sudo juju-run -u {_unit} "juju-reboot --now" || '
217+
f'sudo juju-exec -u {_unit} "juju-reboot --now"'])
217218

218219
def test_run_via_ssh(self):
219220
_unit = "app/2"

zaza/utilities/generic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,9 @@ def juju_reboot(unit_name):
519519
with update-status hooks causing intermittent CI failures).
520520
"""
521521
cmd = ['juju', 'ssh', unit_name,
522-
'sudo juju-run -u {} "juju-reboot --now"'.format(unit_name)]
522+
'sudo juju-run -u {} "juju-reboot --now" || '
523+
'sudo juju-exec -u {} "juju-reboot --now"'
524+
.format(unit_name, unit_name)]
523525
try:
524526
subprocess.check_call(cmd)
525527
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)