Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316777 Details for
Bug 460585
update virtinst to install f10 xen guests
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Parse treeinfo file if located in tree and add f10 os entry
virtinst-0.300.2-f10-treeinfo.patch (text/plain), 6.85 KB, created by
Cole Robinson
on 2008-09-15 19:42:06 UTC
(
hide
)
Description:
Parse treeinfo file if located in tree and add f10 os entry
Filename:
MIME Type:
Creator:
Cole Robinson
Created:
2008-09-15 19:42:06 UTC
Size:
6.85 KB
patch
obsolete
>diff -rup --exclude='*.orig' orig/virtinst/FullVirtGuest.py new/virtinst/FullVirtGuest.py >--- orig/virtinst/FullVirtGuest.py 2008-09-15 14:28:56.358268000 -0400 >+++ new/virtinst/FullVirtGuest.py 2008-09-15 14:53:32.778595000 -0400 >@@ -45,6 +45,7 @@ class FullVirtGuest(Guest.XenGuest): > "fedora7": { "label": "Fedora 7", "distro": "fedora" }, \ > "fedora8": { "label": "Fedora 8", "distro": "fedora" }, \ > "fedora9": { "label": "Fedora 9", "distro": "fedora" }, \ >+ "fedora10": { "label": "Fedora 10", "distro": "fedora" }, \ > "sles10": { "label": "Suse Linux Enterprise Server", "distro": "suse" }, \ > "debianEtch": { "label": "Debian Etch", "distro": "debian" }, \ > "debianLenny": { "label": "Debian Lenny", "distro": "debian" }, \ >diff -rup --exclude='*.orig' orig/virtinst/OSDistro.py new/virtinst/OSDistro.py >--- orig/virtinst/OSDistro.py 2008-09-15 14:28:56.344281000 -0400 >+++ new/virtinst/OSDistro.py 2008-09-15 15:15:41.181364000 -0400 >@@ -24,6 +24,7 @@ import os > import gzip > import re > import tempfile >+import ConfigParser > > from virtinst import _virtinst as _ > from ImageFetcher import ImageFetcher >@@ -51,14 +52,46 @@ class Distro: > # Base image store for any Red Hat related distros which have > # a common layout > class RedHatDistro(Distro): >+ def __init__(self, uri, type=None, scratchdir=None, arch=None): >+ Distro.__init__(self, uri, type, scratchdir, arch) >+ self.treeinfo = None >+ >+ def hasTreeinfo(self, fetcher, progresscb): >+ # all Red Hat based distros should have .treeinfo / execute only once >+ if not (self.treeinfo is None): >+ return True >+ >+ if not fetcher.hasFile(".treeinfo", progresscb): >+ return False >+ >+ logging.debug("Detected .treeinfo file") >+ >+ tmptreeinfo = fetcher.acquireFile(".treeinfo", progresscb) >+ try: >+ self.treeinfo = ConfigParser.SafeConfigParser() >+ self.treeinfo.read(tmptreeinfo) >+ finally: >+ os.unlink(tmptreeinfo) >+ >+ return True > > def acquireKernel(self, fetcher, progresscb): >- if self.type is None: >- kernelpath = "images/pxeboot/vmlinuz" >- initrdpath = "images/pxeboot/initrd.img" >+ if self.hasTreeinfo(fetcher, progresscb): >+ if self.type == "xen": >+ type = "xen" >+ else: >+ type = self.treeinfo.get("general", "arch") >+ >+ kernelpath = self.treeinfo.get("images-%s" % type, "kernel") >+ initrdpath = self.treeinfo.get("images-%s" % type, "initrd") > else: >- kernelpath = "images/%s/vmlinuz" % (self.type) >- initrdpath = "images/%s/initrd.img" % (self.type) >+ # fall back to old code >+ if self.type is None: >+ kernelpath = "images/pxeboot/vmlinuz" >+ initrdpath = "images/pxeboot/initrd.img" >+ else: >+ kernelpath = "images/%s/vmlinuz" % (self.type) >+ initrdpath = "images/%s/initrd.img" % (self.type) > > kernel = fetcher.acquireFile(kernelpath, progresscb) > try: >@@ -76,43 +109,63 @@ class RedHatDistro(Distro): > os.unlink(kernel) > > def acquireBootDisk(self, fetcher, progresscb): >- return fetcher.acquireFile("images/boot.iso", progresscb) >+ if self.hasTreeinfo(fetcher, progresscb): >+ if self.type == "xen": >+ type = "xen" >+ else: >+ type = self.treeinfo.get("general", "arch") >+ return fetcher.acquireFile(self.treeinfo.get("images-%s" % type, "boot.iso"), progresscb) >+ else: >+ return fetcher.acquireFile("images/boot.iso", progresscb) > > # Fedora distro check > class FedoraDistro(RedHatDistro): > def isValidStore(self, fetcher, progresscb): >- if fetcher.hasFile(".treeinfo", progresscb): >- logging.debug("Detected a Fedora distro") >- return True >- if fetcher.hasFile("fedora.css", progresscb): >- logging.debug("Detected a Fedora distro") >- return True >- if fetcher.hasFile("Fedora", progresscb): >- logging.debug("Detected a Fedora distro") >- return True >- return False >+ if self.hasTreeinfo(fetcher, progresscb): >+ m = re.match(".*Fedora.*", self.treeinfo.get("general", "family")) >+ return (m != None) >+ else: >+ # fall back to old code >+ if fetcher.hasFile("fedora.css", progresscb): >+ logging.debug("Detected a Fedora distro") >+ return True >+ if fetcher.hasFile("Fedora", progresscb): >+ logging.debug("Detected a Fedora distro") >+ return True >+ return False > >-# Fedora distro check >+# Red Hat Enterprise Linux distro check > class RHELDistro(RedHatDistro): > def isValidStore(self, fetcher, progresscb): >- if fetcher.hasFile("Server", progresscb): >- logging.debug("Detected a RHEL 5 Server distro") >- return True >- if fetcher.hasFile("Client", progresscb): >- logging.debug("Detected a RHEL 5 Client distro") >- return True >- if fetcher.hasFile("RedHat", progresscb): >- logging.debug("Detected a RHEL 4 distro") >- return True >+ if self.hasTreeinfo(fetcher, progresscb): >+ m = re.match(".*Red Hat Enterprise Linux.*", self.treeinfo.get("general", "family")) >+ return (m != None) >+ else: >+ # fall back to old code >+ if fetcher.hasFile("Server", progresscb): >+ logging.debug("Detected a RHEL 5 Server distro") >+ return True >+ if fetcher.hasFile("Client", progresscb): >+ logging.debug("Detected a RHEL 5 Client distro") >+ return True >+ if fetcher.hasFile("RedHat", progresscb): >+ logging.debug("Detected a RHEL 4 distro") >+ return True > return False > > # CentOS distro check > class CentOSDistro(RedHatDistro): > def isValidStore(self, fetcher, progresscb): >- if fetcher.hasFile("CentOS", progresscb): >- logging.debug("Detected a CentOS distro") >- return True >- return False >+ if self.hasTreeinfo(fetcher, progresscb): >+ m = re.match(".*CentOS.*", self.treeinfo.get("general", "family")) >+ return (m != None) >+ else: >+ # fall back to old code >+ if fetcher.hasFile("CentOS", progresscb): >+ logging.debug("Detected a CentOS distro") >+ return True >+ return False >+ > > # Scientific Linux distro check > class SLDistro(RedHatDistro):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 460585
: 316777