~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to virtinst/OSDistro.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-24 08:52:01 UTC
  • mfrom: (1.6.8 sid)
  • Revision ID: package-import@ubuntu.com-20120724085201-q3h0cbabg4t46gfm
Tags: 0.600.2-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch.
  - debian/patches/9004_ubuntu_fix_tree_support.patch: Fix tree detection
    for all ISO/HTTP source, to not longer fail with cobbler/koan.
  - debian/patches/0004-Fix-path-to-qemu-dm.patch: fix the path to the
    qemu-dm binary.
  - debian/{control,rules,pyversions}: Build using dh_python2, use
    debhelper v8 instead of cdbs; for some reason the package build an
    empty binary package when using dh_python2.
  - debian/control: added acl package to depends.
  - debian/control: added libvirt-bin to recommends
* Dropped patches:
  - debian/patches/9005_ubuntu_releases.patch: Upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
    _hvm_kernel_paths = []
241
241
    _xen_kernel_paths = []
242
242
    uses_treeinfo = False
 
243
    method_arg = "method"
243
244
 
244
245
    def __init__(self, uri, arch, vmtype=None, scratchdir=None):
245
246
        self.uri = uri
373
374
        args = ''
374
375
 
375
376
        if not fetcher.location.startswith("/"):
376
 
            args += "method=" + fetcher.location
 
377
            args += "%s=%s" % (self.method_arg, fetcher.location)
377
378
 
378
379
        if guest.extraargs:
379
380
            args += " " + guest.extraargs
492
493
            ret = (m != None)
493
494
 
494
495
            if ret:
 
496
                lateststr, latestnum = self._latestFedoraVariant()
495
497
                ver = self.treeinfo.get("general", "version")
496
498
                if ver == "development":
497
499
                    self.os_variant = self._latestFedoraVariant()
498
500
                elif ver:
499
 
                    self.os_variant = "fedora" + (str(ver).split("-"))[0]
 
501
                    vernum = int(str(ver).split("-")[0])
 
502
                    if vernum > latestnum:
 
503
                        self.os_variant = lateststr
 
504
                    else:
 
505
                        self.os_variant = "fedora" + str(vernum)
 
506
 
500
507
 
501
508
            return ret
502
509
        else:
509
516
        ret = None
510
517
        for var in osdict.sort_helper(osdict.OS_TYPES["linux"]["variants"]):
511
518
            if var.startswith("fedora"):
512
 
                # Last fedora* occurence should be the newest
 
519
                # First fedora* occurence should be the newest
513
520
                ret = var
514
 
        return ret
 
521
                break
 
522
 
 
523
        return ret, int(ret[6:])
515
524
 
516
525
# Red Hat Enterprise Linux distro check
517
526
class RHELDistro(RedHatDistro):
655
664
 
656
665
    name = "SUSE"
657
666
    os_type = "linux"
 
667
    method_arg = "install"
658
668
    _boot_iso_paths   = [ "boot/boot.iso" ]
659
669
 
660
670
    def __init__(self, uri, arch, vmtype=None, scratchdir=None):
889
899
 
890
900
class DebianDistro(Distro):
891
901
    # ex. http://ftp.egr.msu.edu/debian/dists/sarge/main/installer-i386/
892
 
    # daily builds: http://d-i.debian.org/daily-images/amd64/ 
 
902
    # daily builds: http://d-i.debian.org/daily-images/amd64/
893
903
 
894
904
    name = "Debian"
895
905
    os_type = "linux"