Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/181'
Browse files Browse the repository at this point in the history
* origin/pr/181:
  Improve TestVM and TestVMCollection capabilities
  Fix too-narrow exception caught in qvm_shutdown
  • Loading branch information
marmarek committed Sep 11, 2021
2 parents c4d2b8f + 4b865ed commit f24b18d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions qubesadmin/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def __init__(self, name, **kwargs):
def get_power_state(self):
return getattr(self, 'power_state', 'Running')

def is_networked(self):
return bool(getattr(self, 'netvm', False))

def __str__(self):
return self.name

Expand All @@ -50,6 +53,8 @@ class TestVMCollection(dict):
def __iter__(self):
return iter(self.values())

get_blind = dict.get


class TestProcess(object):
def __init__(self, input_callback=None, stdout=None, stderr=None, stdout_data=None):
Expand Down
2 changes: 1 addition & 1 deletion qubesadmin/tools/qvm_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def main(args=None, app=None): # pylint: disable=missing-docstring
for vm in this_round_domains:
try:
vm.shutdown(force=force)
except qubesadmin.exc.QubesVMNotRunningError:
except qubesadmin.exc.QubesVMNotStartedError:
pass
except qubesadmin.exc.QubesException as e:
if not args.wait:
Expand Down

0 comments on commit f24b18d

Please sign in to comment.