[virt-tools-list] [PATCH] Add support for an Ubuntu HTTP source when it is a mounted ISO

Andres Rodriguez andreserl at ubuntu.com
Tue Apr 19 16:20:52 UTC 2011


When the installation source is a mounted ISO (or even cobbler imported ISO) on a
HTTP source, the UbuntDistro is not correctly detected causing the installation to
fail by not detecting it as an Ubuntu source.
This patch fixes the approach to determine whether the source is an Ubuntu source.
Additionally, removes the lookup of daily trees as Ubuntu do not provide them as
done with Debian.
---
 virtinst/OSDistro.py |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/virtinst/OSDistro.py b/virtinst/OSDistro.py
index ddda9fb..314b87d 100644
--- a/virtinst/OSDistro.py
+++ b/virtinst/OSDistro.py
@@ -943,6 +943,29 @@ class DebianDistro(Distro):
 
 class UbuntuDistro(DebianDistro):
     name = "Ubuntu"
+    # regular tree: http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/
+
+    def isValidStore(self, fetcher, progresscb):
+        if fetcher.hasFile("%s/MANIFEST" % self._prefix):
+            # For regular trees
+            filename = "%s/MANIFEST" % self._prefix
+            regex = ".*%s.*" % self._installer_name
+        elif fetcher.hasFile("install/netboot/version.info"):
+            # For trees based on ISO's
+            self._prefix = "install"
+            self._set_media_paths()
+            filename = "%s/netboot/version.info" % self._prefix
+            regex = "%s*" % self.name
+        else:
+            logging.debug("Doesn't look like an %s Distro." % self.name)
+            return False
+
+        if self._fetchAndMatchRegex(fetcher, progresscb, filename, regex):
+            logging.debug("Detected an %s distro" % self.name)
+            return True
+
+        logging.debug("Regex didn't match, not an %s distro" % self.name)
+        return False
 
 
 class MandrivaDistro(Distro):
-- 
1.7.4.1




More information about the virt-tools-list mailing list