parent
47188a38e5
commit
b8d1884cb1
@ -1,4 +1,4 @@
|
|||||||
# -*- encoding: utf8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# The Qubes OS Project, http://www.qubes-os.org
|
# The Qubes OS Project, http://www.qubes-os.org
|
||||||
#
|
#
|
||||||
@ -52,7 +52,6 @@ class TC_00_qvm_kill(qubesadmin.tests.QubesTestCase):
|
|||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
def test_003_not_running(self):
|
def test_003_not_running(self):
|
||||||
# TODO: some option to ignore this error?
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('some-vm', 'admin.vm.Kill', None, None)] = \
|
('some-vm', 'admin.vm.Kill', None, None)] = \
|
||||||
b'2\x00QubesVMNotStartedError\x00\x00Domain is powered off: ' \
|
b'2\x00QubesVMNotStartedError\x00\x00Domain is powered off: ' \
|
||||||
@ -62,6 +61,6 @@ class TC_00_qvm_kill(qubesadmin.tests.QubesTestCase):
|
|||||||
b'0\x00some-vm class=AppVM state=Halted\n'
|
b'0\x00some-vm class=AppVM state=Halted\n'
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
qubesadmin.tools.qvm_kill.main(['some-vm'], app=self.app),
|
qubesadmin.tools.qvm_kill.main(['some-vm'], app=self.app),
|
||||||
1)
|
0)
|
||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ import qubesadmin.tools
|
|||||||
parser = qubesadmin.tools.QubesArgumentParser(
|
parser = qubesadmin.tools.QubesArgumentParser(
|
||||||
description='forceful shutdown of a domain', vmname_nargs='+')
|
description='forceful shutdown of a domain', vmname_nargs='+')
|
||||||
|
|
||||||
|
|
||||||
def main(args=None, app=None):
|
def main(args=None, app=None):
|
||||||
'''Main routine of :program:`qvm-kill`.
|
'''Main routine of :program:`qvm-kill`.
|
||||||
|
|
||||||
@ -42,6 +41,8 @@ def main(args=None, app=None):
|
|||||||
for domain in args.domains:
|
for domain in args.domains:
|
||||||
try:
|
try:
|
||||||
domain.kill()
|
domain.kill()
|
||||||
|
except qubesadmin.exc.QubesVMNotStartedError:
|
||||||
|
pass
|
||||||
except (IOError, OSError, qubesadmin.exc.QubesException) as e:
|
except (IOError, OSError, qubesadmin.exc.QubesException) as e:
|
||||||
exit_code = 1
|
exit_code = 1
|
||||||
parser.print_error(str(e))
|
parser.print_error(str(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user