diff options
author | Jeremy Katz <katzj@redhat.com> | 2007-12-17 14:51:44 -0500 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2007-12-17 14:52:02 -0500 |
commit | f2d5ded837c3bd2f2ec1f6f0f3cd8d312ca509b9 (patch) | |
tree | a49a05629d56e92f4f1561c938250dc3a0da04c6 | |
parent | dd5f09536eb6d67eebd637fd0f7750cc22912d3e (diff) | |
download | anaconda-f2d5ded837c3bd2f2ec1f6f0f3cd8d312ca509b9.tar.gz anaconda-f2d5ded837c3bd2f2ec1f6f0f3cd8d312ca509b9.tar.xz anaconda-f2d5ded837c3bd2f2ec1f6f0f3cd8d312ca509b9.zip |
Make doMethodComplete not depend on the yum backend
Move backend specific bits of method complete into a backend.complete() method
to avoid tracebacks with installs on other backends
-rw-r--r-- | backend.py | 3 | ||||
-rw-r--r-- | installmethod.py | 18 | ||||
-rw-r--r-- | yuminstall.py | 19 |
3 files changed, 23 insertions, 17 deletions
diff --git a/backend.py b/backend.py index 3d72dc30e..80c79f0f4 100644 --- a/backend.py +++ b/backend.py @@ -185,6 +185,9 @@ class AnacondaBackend: log.warning("getRequiredMedia not implmented for backend!") pass + def complete(self, anaconda): + pass + def doRepoSetup(anaconda): anaconda.backend.doInitialSetup(anaconda) if anaconda.backend.doRepoSetup(anaconda) == DISPATCH_BACK: diff --git a/installmethod.py b/installmethod.py index 3d6d2f8af..77f4a39e3 100644 --- a/installmethod.py +++ b/installmethod.py @@ -27,23 +27,7 @@ log = logging.getLogger("anaconda") import isys, product def doMethodComplete(anaconda): - try: - isys.umount(anaconda.backend.ayum.tree) - except Exception: - pass - - if anaconda.mediaDevice: - try: - shutil.copyfile("%s/media.repo" % anaconda.backend.ayum.tree, - "%s/etc/yum.repos.d/%s-install-media.repo" %(anaconda.rootPath, productName)) - except Exception, e: - log.debug("Error copying media.repo: %s" %(e,)) - - if anaconda.backend.ayum._loopbackFile and (anaconda.mediaDevice or anaconda.backend.ayum.isodir): - try: - os.unlink(anaconda.backend.ayum._loopbackFile) - except SystemError: - pass + anaconda.backend.complete(anaconda) if not anaconda.isKickstart and anaconda.mediaDevice: isys.ejectCdrom(anaconda.mediaDevice) diff --git a/yuminstall.py b/yuminstall.py index 8e2d7bdbf..6af8b6513 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -743,6 +743,25 @@ class YumBackend(AnacondaBackend): AnacondaBackend.__init__(self, anaconda) self.supportsPackageSelection = True + def complete(self, anaconda): + try: + isys.umount(self.ayum.tree) + except Exception: + pass + + if anaconda.mediaDevice: + try: + shutil.copyfile("%s/media.repo" % self.ayum.tree, + "%s/etc/yum.repos.d/%s-install-media.repo" %(anaconda.rootPath, productName)) + except Exception, e: + log.debug("Error copying media.repo: %s" %(e,)) + + if self.ayum._loopbackFile and (anaconda.mediaDevice or self.isodir): + try: + os.unlink(self.ayum._loopbackFile) + except SystemError: + pass + def doInitialSetup(self, anaconda): if anaconda.id.getUpgrade(): # FIXME: make sure that the rpmdb doesn't have stale locks :/ |