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