create-vm: Handle the case when no HVM-template exists

This commit is contained in:
Marek Marczykowski-Górecki 2014-06-07 04:40:24 +02:00
parent aca43a46da
commit ca6cc8e01f

View File

@ -194,6 +194,9 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
template_vm = None
if self.template_name.isEnabled():
if len(self.template_vm_list) == 0:
QMessageBox.warning (None, "No template available!", "Cannot create non-standalone VM when no compatible template exists. Create template VM first or choose to create standalone VM.")
return
template_vm = self.template_vm_list[self.template_name.currentIndex()]
netvm = None