Skip to content

Commit

Permalink
Adjust qvm.template_installed to use qvm-check
Browse files Browse the repository at this point in the history
Use qvm-check --template to check if the template exists. This covers
the case of in-place upgraded templates, in addition to those installed
with qvm-template directly.

Fixes QubesOS/qubes-issues#9818
  • Loading branch information
marmarek committed Mar 2, 2025
1 parent 8112f14 commit 6837aca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _states/ext_state_qvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ def template_installed(name, fromrepo=None, pool=None, **kwargs):
Install into given storage pool. Will not move already installed template.
"""
ret = {'name': name, 'result': False, 'changes': {}, 'comment': ''}
info = __salt__['qvm.template_info'](name)
info = __salt__['qvm.check'](name, flags=['template'])
if info:
ret['result'] = True
ret['comment'] = 'Template {} version {} already installed'.format(
info['name'], info['version'])
ret['comment'] = 'Template {} already installed'.format(
info['name'])
return ret
if __opts__['test']:
ret['result'] = None
Expand Down

0 comments on commit 6837aca

Please sign in to comment.