Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ deps =
lxml
mock
netaddr
libosinfo
commands =
python -m unittest discover

Expand Down
11 changes: 9 additions & 2 deletions virtdeploy/drivers/libvirt.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,17 @@ def instance_delete(self, vmid):


def _get_image_os(image):
try:
if image in _IMAGE_OS_TABLE:
return _IMAGE_OS_TABLE[image]
except KeyError:
stdout, _ = execute(('osinfo-query', '--fields=short-id', 'os'),
stdout=subprocess.PIPE)
stdtable=stdout.split()
if image.replace('-', '') in stdtable:
return image.replace('-', '')
if image in stdtable:
return image
else:
return "fedora20"


def _create_base(template, arch, repository):
Expand Down