storage: fix handling standalone VMs

Currently Standalone have template=None.
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-11 05:44:38 +01:00 committed by Wojtek Porczyk
parent a73c694f54
commit 8262f2ef4b

View File

@ -72,7 +72,8 @@ class XenStorage(qubes.storage.Storage):
@property
def root_img(self):
'''Path to the root image'''
return self.vm.template.storage.root_img if hasattr(self.vm, 'template') \
return self.vm.template.storage.root_img \
if hasattr(self.vm, 'template') and self.vm.template \
else self.abspath(qubes.config.vm_files['root_img'])