summaryrefslogtreecommitdiffstats
path: root/installmethod.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-12-04 19:41:01 -0500
committerChris Lumens <clumens@redhat.com>2007-12-05 10:30:45 -0500
commit52a9331a20f82fd6f3aef18492fd2af61f830bdf (patch)
tree9e577d962cc2f01656e681c8705080bbfad0759c /installmethod.py
parentf6e2614efd36df057897cafe3e49bc0957f60376 (diff)
downloadanaconda-52a9331a20f82fd6f3aef18492fd2af61f830bdf.tar.gz
anaconda-52a9331a20f82fd6f3aef18492fd2af61f830bdf.tar.xz
anaconda-52a9331a20f82fd6f3aef18492fd2af61f830bdf.zip
Remove base InstallMethod class and harddrive.py and urlinstall.py files.
This commit removes the base InstallMethod class without removing the users in other files, so obviously this commit cannot stand alone. installmethod.py and image.py at the very least still need significant changes.
Diffstat (limited to 'installmethod.py')
-rw-r--r--installmethod.py83
1 files changed, 18 insertions, 65 deletions
diff --git a/installmethod.py b/installmethod.py
index 368b018c0..9eb7d32e1 100644
--- a/installmethod.py
+++ b/installmethod.py
@@ -11,79 +11,32 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-import os
-import string
+import os, shutil, string
from constants import *
import logging
log = logging.getLogger("anaconda")
-import isys
+import isys, product
-## The base installation method class.
-# This is an abstract class that defines the methods that make up an
-# installation method. This class should not be used except as the superclass
-# for a specific method. Most methods in this class should be redefined by
-# subclasses, though things like mountCD, unmountCD, ejectCD, and the cleanup
-# methods may not need to be redefined. By default, most methods pass.
-class InstallMethod:
- ## Perform method-specific actions to mount any installation media.
- # @param fsset An instance of FileSystemSet.
- # @param mntPoint The root of the filesystem to mount the media onto.
- def systemMounted(self, fsset, mntPoint):
- pass
-
- ## Method-specific cleanup function to be called at the end of installation.
- # @see doMethodComplete
- # @see postAction
- def filesDone(self):
- pass
-
- ## The constructor.
- # @param method The --method= parameter passed to anaconda from loader.
- # @param rootpath The --rootpath= parameter passed to anaconda from loader.
- # @param intf An instance of the InstallInterface class.
- def __init__(self, method, rootpath, intf):
- self.rootPath = rootpath
- self.intf = intf
- self.tree = None
-
- ## Get the base URI for the method.
- # @return The base URI for this installation method.
- def getMethodUri(self):
- pass
-
- ## Unmount any CD media.
- def unmountCD(self):
- pass
-
- ## Switch CDs.
- # @param mediano The CD media number to switch to.
- # @param filename The file to be read that requires switching media.
- def switchMedia(self, mediano, filename=""):
- pass
-
- ## Method to be run at the very end of installation.
- #
- # This method is run very late. It's the last step to be run before
- # showing the completion screen. Only use this if you really know what
- # you're doing.
- # @param anaconda An instance of the Anaconda class.
- # @see filesDone
- # @see doMethodComplete
- def postAction(self, anaconda):
+def doMethodComplete(anaconda):
+ try:
+ isys.umount(anaconda.backend.ayum.tree)
+ except Exception:
pass
-## Do method-specific cleanups.
-#
-# This occurs very late and is mainly used for unmounting media and ejecting
-# the CD. If we're on a kickstart install, don't eject the CD since there's
-# a kickstart command to do that.
-# @param anaconda An instance of the Anaconda class.
-# @see InstallMethod::postAction
-# @see InstallMethod::filesDone
-def doMethodComplete(anaconda):
- anaconda.method.filesDone()
+ if anaconda.methodstr.startswith("cdrom://"):
+ 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:
+ try:
+ os.unlink(anaconda.backend.ayum._loopbackFile)
+ except SystemError:
+ pass
if not anaconda.isKickstart:
isys.ejectCdrom(anaconda.method.device, makeDevice=1)