[PATCH 2/2] updateBaseRepo does not need a storage argument.
Chris Lumens
clumens at redhat.com
Mon Oct 29 18:09:51 UTC 2012
It can get it as an attribute off the Payload object, now that setup is
always being called.
---
pyanaconda/packaging/__init__.py | 4 ++--
pyanaconda/packaging/yumpayload.py | 7 +++----
pyanaconda/ui/gui/spokes/source.py | 3 +--
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index e415fbb..25d4aa2 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -220,7 +220,7 @@ class Payload(object):
self.data.method.proxy = ""
self.data.method.opts = None
- def updateBaseRepo(self, storage):
+ def updateBaseRepo(self):
""" Update the base repository from ksdata.method. """
pass
@@ -744,7 +744,7 @@ if __name__ == "__main__":
ksdata.method.url = "http://dl.fedoraproject.org/pub/fedora/linux/development/17/x86_64/os/"
# now switch the base repo to what we set ksdata.method to just above
- payload.updateBaseRepo(storage)
+ payload.updateBaseRepo()
for repo in payload._yum.repos.repos.values():
print repo.name, repo.enabled
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 25372cb..6b423fc 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -155,7 +155,7 @@ class YumPayload(PackagePayload):
self._writeYumConfig()
self._setup = True
- self.updateBaseRepo(storage)
+ self.updateBaseRepo()
# When setup is called, it's already in a separate thread. That thread
# will try to select groups right after this returns, so make sure we
@@ -375,8 +375,7 @@ reposdir=%s
return base_repo_name
- def updateBaseRepo(self, storage, fallback=True, root=None,
- checkmount=True):
+ def updateBaseRepo(self, fallback=True, root=None, checkmount=True):
""" Update the base repo based on self.data.method.
- Tear down any previous base repo devices, symlinks, &c.
@@ -395,7 +394,7 @@ reposdir=%s
# see if we can get a usable base repo from self.data.method
try:
- self._configureBaseRepo(storage, checkmount=checkmount)
+ self._configureBaseRepo(self.storage, checkmount=checkmount)
except PayloadError as e:
if not fallback:
for repo in self._yum.repos.repos.values():
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 6f56523..50545b6 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -507,8 +507,7 @@ class SourceSpoke(NormalSpoke):
communication.send_not_ready("SoftwareSelectionSpoke")
try:
- self.payload.updateBaseRepo(self.storage, fallback=False,
- checkmount=False)
+ self.payload.updateBaseRepo(fallback=False, checkmount=False)
except PayloadError as e:
log.error("PayloadError: %s" % (e,))
self._error = True
--
1.7.11.2
More information about the anaconda-patches
mailing list