Added more libvirt uri mappings + canonizalized them better.
This commit is contained in:
parent
b5f1f4611c
commit
a27b693ea9
@ -29,6 +29,8 @@ LIBVIRT_PROTOCOL_MAP = {
|
|||||||
'qemu': "qemu:///system",
|
'qemu': "qemu:///system",
|
||||||
'kvm': "qemu:///system",
|
'kvm': "qemu:///system",
|
||||||
'xen': 'xen:///',
|
'xen': 'xen:///',
|
||||||
|
'uml': 'uml:///system',
|
||||||
|
'lxc': 'lxc:///',
|
||||||
}
|
}
|
||||||
VIRT_TYPE = 'libvirt'
|
VIRT_TYPE = 'libvirt'
|
||||||
VIRT_LIB = VIRT_TYPE
|
VIRT_LIB = VIRT_TYPE
|
||||||
@ -108,7 +110,10 @@ def restart(distro):
|
|||||||
|
|
||||||
|
|
||||||
def default(virt_type):
|
def default(virt_type):
|
||||||
if not virt_type or not LIBVIRT_PROTOCOL_MAP.get(virt_type):
|
if not virt_type:
|
||||||
|
return DEFAULT_VIRT
|
||||||
|
virt_type = virt_type.lower().strip()
|
||||||
|
if not virt_type in LIBVIRT_PROTOCOL_MAP:
|
||||||
return DEFAULT_VIRT
|
return DEFAULT_VIRT
|
||||||
else:
|
else:
|
||||||
return virt_type
|
return virt_type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user