[virt-tools-list] [PATCH v2 virt-manager 1/2] virtinst: DistroInstaller uses libosinfo detection first
Giuseppe Scrivano
gscrivan at redhat.com
Wed Mar 26 11:19:15 UTC 2014
Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
virtinst/distroinstaller.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/virtinst/distroinstaller.py b/virtinst/distroinstaller.py
index ec63ec3..1341314 100644
--- a/virtinst/distroinstaller.py
+++ b/virtinst/distroinstaller.py
@@ -1,5 +1,5 @@
#
-# Copyright 2006-2009, 2013 Red Hat, Inc.
+# Copyright 2006-2009, 2013, 2014 Red Hat, Inc.
# Daniel P. Berrange <berrange at redhat.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,7 @@ from virtinst import util
from virtinst import Installer
from virtinst import VirtualDisk
from virtinst import urlfetcher
+from virtinst import osdict
def _is_url(conn, url):
@@ -473,6 +474,14 @@ class DistroInstaller(Installer):
def detect_distro(self, guest):
try:
+ os = osdict.lookup_os_by_media(self.location)
+ if os:
+ logging.debug("installer.detect_distro returned=%s", os)
+ return os
+ except:
+ pass
+
+ try:
ret = urlfetcher.detectMediaDistro(guest, self.location)
logging.debug("installer.detect_distro returned=%s", ret)
return ret
--
1.8.5.3
More information about the virt-tools-list
mailing list