qvm-template: Use "vm.features.get" instead of explicit membership check.

This commit is contained in:
WillyPillow 2020-08-04 01:38:52 +08:00
parent 582c87644d
commit e482b9eb0f
No known key found for this signature in database
GPG Key ID: 3839E194B1415A9C

View File

@ -218,8 +218,7 @@ def query_local_evr(vm):
vm.features['template-release'])
def is_managed_template(vm):
return 'template-name' in vm.features \
and vm.name == vm.features['template-name']
return vm.features.get('template-name', None) == vm.name
def get_managed_template_vm(app, name):
if name not in app.domains: