mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(vrtManager): an architecture the host does not run is refused, not a 500
The create page and the API's create take the architecture from the URL. One the host's capabilities do not list raised a KeyError in get_dom_cap_xml: an HTML 500 for both. It is now "This host has no architecture noarch": the page shows it, the API answers 400.
This commit is contained in:
parent
6d22a18ba7
commit
9d22d48a85
6 changed files with 24 additions and 19 deletions
|
|
@ -497,7 +497,10 @@ class wvmConnect(object):
|
|||
def get_dom_cap_xml(self, arch, machine):
|
||||
""" Return domain capabilities xml"""
|
||||
emulatorbin = self.get_emulator(arch)
|
||||
virttype = "kvm" if "kvm" in self.get_hypervisors_domain_types()[arch] else "qemu"
|
||||
domain_types = self.get_hypervisors_domain_types().get(arch)
|
||||
if domain_types is None: # the architecture comes from the URL
|
||||
raise util.OperationError(gettext_noop("This host has no architecture %(arch)s"), arch=arch)
|
||||
virttype = "kvm" if "kvm" in domain_types else "qemu"
|
||||
|
||||
machine_types = self.get_machine_types(arch)
|
||||
if not machine or machine not in machine_types:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue