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

Cole Robinson crobinso at redhat.com
Thu Apr 21 13:57:30 UTC 2011


On 04/19/2011 12:20 PM, Andres Rodriguez wrote:
> 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.

Thanks, applied:

http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=12f766f4b47caf0dbab247fa5b56fff32df297de

- Cole

> ---
>  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):




More information about the virt-tools-list mailing list