Skip to content

Commit

Permalink
Merge pull request #665 from fnordahl/fix-juju-reboot
Browse files Browse the repository at this point in the history
utilities: Fix juju_reboot for 3.x.
  • Loading branch information
wolsen authored Aug 27, 2024
2 parents e96ab09 + 2978b89 commit bef1bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion unit_tests/utilities/test_zaza_utilities_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion zaza/utilities/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bef1bdb

Please sign in to comment.