Skip to content

Commit 2536ec0

Browse files
authored
Revome deprecated restart method from VM. Add a reboot replacement (python-oca#34)
1 parent 6a41938 commit 2536ec0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

oca/tests/test_virtualmachine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_actions(self):
9191
oca.client = oca.Client('test:test')
9292
vm = oca.VirtualMachine(self.xml, self.client)
9393
for action in ['shutdown', 'shutdown_hard', 'poweroff', 'poweroff_hard', 'hold', 'release', 'stop', 'cancel',
94-
'suspend', 'resume', 'restart', 'finalize', 'delete']:
94+
'suspend', 'resume', 'reboot', 'finalize', 'delete']:
9595
self.client.call = Mock(return_value='')
9696
getattr(vm, action)()
9797
if action in ('shutdown_hard', 'poweroff_hard', 'undeploy_hard'):

oca/vm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ def finalize(self):
230230
'''
231231
self._action('finalize')
232232

233-
def restart(self):
233+
def reboot(self, hard=False):
234234
'''
235-
Resubmits the VM after failure
235+
Reboot the VM. Optionally perform a hard reboot
236236
'''
237-
self._action('restart')
237+
self._action('reboot-hard' if hard else 'reboot')
238238

239239
def resubmit(self):
240240
'''

0 commit comments

Comments
 (0)