Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/572'
Browse files Browse the repository at this point in the history
* origin/pr/572:
  Correct misleading check_with_* docstrings
  • Loading branch information
marmarek committed Jan 3, 2024
2 parents fca4b99 + 344f59a commit 49c9fc9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions qubes/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,26 @@ def _recursive_check(self, attr=None, *, feature, default,
raise KeyError(feature)

def check_with_template(self, feature, default=_NO_DEFAULT):
'''Check if the subject's template has the specified feature.'''
'''Check for the specified feature; if this VM does not have it,
it checks with its template.'''
return self._recursive_check('template',
feature=feature, default=default)

def check_with_netvm(self, feature, default=_NO_DEFAULT):
'''Check if the subject's netvm has the specified feature.'''
'''Check for the specified feature; if this VM does not have it,
it checks with its netvm.'''
return self._recursive_check('netvm',
feature=feature, default=default)

def check_with_adminvm(self, feature, default=_NO_DEFAULT):
'''Check if the AdminVM has the specified feature.'''
'''Check for the specified feature; if this VM does not have it,
it checks with the AdminVM.'''
return self._recursive_check(check_adminvm=True,
feature=feature, default=default)

def check_with_template_and_adminvm(self, feature, default=_NO_DEFAULT):
'''Check if the template and AdminVM has the specified feature.'''
'''Check for the specified feature; if this VM does not have it,
it checks with its template. If the template does not have it, it
checks with the AdminVM.'''
return self._recursive_check('template', check_adminvm=True,
feature=feature, default=default)

0 comments on commit 49c9fc9

Please sign in to comment.