本文整理汇总了Python中gns3server.compute.qemu.Qemu.get_kvm_archs方法的典型用法代码示例。如果您正苦于以下问题:Python Qemu.get_kvm_archs方法的具体用法?Python Qemu.get_kvm_archs怎么用?Python Qemu.get_kvm_archs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gns3server.compute.qemu.Qemu
的用法示例。
在下文中一共展示了Qemu.get_kvm_archs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_kvm_archs_kvm_ok
# 需要导入模块: from gns3server.compute.qemu import Qemu [as 别名]
# 或者: from gns3server.compute.qemu.Qemu import get_kvm_archs [as 别名]
def test_get_kvm_archs_kvm_ok(loop):
with patch("os.path.exists", return_value=True):
archs = loop.run_until_complete(asyncio.async(Qemu.get_kvm_archs()))
if platform.machine() == 'x86_64':
assert archs == ['x86_64', 'i386']
else:
assert archs == [platform.machine()]
with patch("os.path.exists", return_value=False):
archs = loop.run_until_complete(asyncio.async(Qemu.get_kvm_archs()))
assert archs == []
示例2: get_capabilities
# 需要导入模块: from gns3server.compute.qemu import Qemu [as 别名]
# 或者: from gns3server.compute.qemu.Qemu import get_kvm_archs [as 别名]
def get_capabilities(request, response):
capabilities = {"kvm": []}
kvms = yield from Qemu.get_kvm_archs()
if kvms:
capabilities["kvm"] = kvms
response.json(capabilities)