[rhel7 1/2] refactor into _setupInstallDevice (#882279)
Brian C. Lane
bcl at redhat.com
Sat Nov 23 01:46:40 UTC 2013
From: "Brian C. Lane" <bcl at redhat.com>
Move part of _configureBaseRepo into _setupInstallDevice, similar to
commit f1d35e92d, but leaving it in yumpayload.py to minimize changes.
Related: rhbz#882279
---
pyanaconda/packaging/yumpayload.py | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index e077a49..90c79c8 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -617,19 +617,14 @@ reposdir=%s
else:
device.format.setup(mountpoint=INSTALL_TREE)
- def _configureBaseRepo(self, storage, checkmount=True):
- """ Configure the base repo.
+ def _setupInstallDevice(self, storage, checkmount):
+ """ Setup the install device
- If self.data.method.method is set, failure to configure a base repo
- should generate a PayloadError exception.
-
- If self.data.method.method is unset, no exception should be raised
- and no repo should be configured.
+ Based on the method, and devices mounted by dracut, setup
+ the install device and return the url or mirrorlist.
- If checkmount is true, check the dracut mount to see if we have
- usable media mounted.
+ :returns: url, mirrorlist, sslverify
"""
- log.info("configuring base repo")
# set up the main repo specified by method=, repo=, or ks method
# XXX FIXME: does this need to handle whatever was set up by dracut?
# XXX FIXME: most of this probably belongs up in Payload
@@ -766,6 +761,23 @@ reposdir=%s
elif method.method == "cdrom":
raise PayloadSetupError("no usable optical media found")
+ return url, mirrorlist, sslverify
+
+ def _configureBaseRepo(self, storage, checkmount=True):
+ """ Configure the base repo.
+
+ If self.data.method.method is set, failure to configure a base repo
+ should generate a PayloadError exception.
+
+ If self.data.method.method is unset, no exception should be raised
+ and no repo should be configured.
+
+ If checkmount is true, check the dracut mount to see if we have
+ usable media mounted.
+ """
+ log.info("configuring base repo")
+ url, mirrorlist, sslverify = self._setupInstallDevice(storage, checkmount)
+ method = self.data.method
if method.method:
with _yum_lock:
try:
--
1.8.3.1
More information about the anaconda-patches
mailing list