machine: use virtualization.virt_identifier property

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
Pedro Lamas 2022-11-22 09:52:03 +00:00 committed by Eric Callahan
parent c61ff8b252
commit b67a08a65b
1 changed files with 2 additions and 1 deletions

View File

@ -232,7 +232,8 @@ class Machine:
async def _handle_machine_request(self, web_request: WebRequest) -> str:
ep = web_request.get_endpoint()
if self.inside_container:
virt_id = self.system_info['virtualization'].get('virt_id', "none")
virt_id = self.system_info['virtualization'].get(
'virt_identifier', "none")
raise self.server.error(
f"Cannot {ep.split('/')[-1]} from within a "
f"{virt_id} container")