1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 23:55:24 +00:00

Check firmware secure keyword with safe way to prevent key not exist

This commit is contained in:
catborise 2019-12-19 16:06:06 +03:00
parent d401d2f3ff
commit c6cdb4929c
2 changed files with 2 additions and 1 deletions

View file

@ -219,6 +219,7 @@ def create_instance(request, compute_id, arch, machine):
if data['cache_mode'] not in conn.get_cache_modes(): if data['cache_mode'] not in conn.get_cache_modes():
error_msg = _("Invalid cache mode") error_msg = _("Invalid cache mode")
error_messages.append(error_msg) error_messages.append(error_msg)
if 'UEFI' in data["firmware"]: if 'UEFI' in data["firmware"]:
firmware["loader"] = data["firmware"].split(":")[1].strip() firmware["loader"] = data["firmware"].split(":")[1].strip()
firmware["secure"] = 'no' firmware["secure"] = 'no'

View file

@ -209,7 +209,7 @@ class wvmCreate(wvmConnect):
xml += """<apic/>""" xml += """<apic/>"""
if 'pae' in caps["features"]: if 'pae' in caps["features"]:
xml += """<pae/>""" xml += """<pae/>"""
if 'yes' == firmware["secure"]: if 'yes' == firmware.get("secure", 'no'):
xml += """<smm state="on"/>""" xml += """<smm state="on"/>"""
xml += """</features>""" xml += """</features>"""