client/rhel/yum-rhn-plugin/rhnplugin.py | 79 ++++++++++++-------------
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 7 +-
rel-eng/packages/yum-rhn-plugin | 2
3 files changed, 48 insertions(+), 40 deletions(-)
New commits:
commit a8661d011b6457d109525a378e3286b714c28bef
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 11:12:37 2011 +0200
Automatic commit of package [yum-rhn-plugin] release [1.5.5-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 728f54d..9b7471c 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -1,6 +1,6 @@
Summary: RHN support for yum
Name: yum-rhn-plugin
-Version: 1.5.4
+Version: 1.5.5
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -72,6 +72,11 @@ fi
%doc LICENSE
%changelog
+* Fri Apr 29 2011 Miroslav Suchý 1.5.5-1
+- code cleanup
+- 691283 - create persistdir in _repos_persistdir instead of PWD
+ (msuchy(a)redhat.com)
+
* Thu Apr 21 2011 Miroslav Suchý 1.5.4-1
- in rhel5 http_header is not present
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index 12ab28d..4f74e89 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-1.5.4-1 client/rhel/yum-rhn-plugin/
+1.5.5-1 client/rhel/yum-rhn-plugin/
commit 72befe9e43ac02dc4794ac0f93d5c290584ad995
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:45:59 2011 +0200
waive pylint errors Class 'YumRepository' has no
'_YumRepository__headersListFromDict' member
we are accessing private method, this is bad, bad. We promise we will not do it again,
but we want to keep this one.
addressing:
E:368:RhnRepo._noExceptionWrappingGet: Class 'YumRepository' has no
'_YumRepository__headersListFromDict' member
E:454:RhnRepo._setupGrab: Class 'YumRepository' has no
'_YumRepository__headersListFromDict' member
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 0fac574..89df90a 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -365,7 +365,7 @@ class RhnRepo(YumRepository):
self.http_headers[AuthUserH] = "\nX-libcurl-Empty-Header-Workaround:
*"
# Turn our dict into a list of 2-tuples
- headers = YumRepository._YumRepository__headersListFromDict(self)
+ headers = YumRepository._YumRepository__headersListFromDict(self) # pylint:
disable-msg=E1101
# We will always prefer to send no-cache.
if not (cache or self.http_headers.has_key('Pragma')):
@@ -451,7 +451,7 @@ class RhnRepo(YumRepository):
'proxies': self.proxy_dict,
'timeout': self.timeout,
}
- headers = tuple(YumRepository._YumRepository__headersListFromDict(self))
+ headers = tuple(YumRepository._YumRepository__headersListFromDict(self)) #
pylint: disable-msg=E1101
self._grabfunc = URLGrabber(
progress_obj=self.callback,
commit 94ff6aa07c26802335de9b26c16d61ff7a421044
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:36:35 2011 +0200
W:510:RhnRepo._getRepoXML: Reimport 'yum.Errors' (imported line 15)
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 16be190..0fac574 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -508,7 +508,6 @@ class RhnRepo(YumRepository):
self.disable()
def _getRepoXML(self):
- import yum.Errors
try:
return YumRepository._getRepoXML(self)
except yum.Errors.RepoError:
commit 44bc97750f8dad31767cfc551ce01bd02c65c3a0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:35:58 2011 +0200
W:513:RhnRepo._getRepoXML: Unused variable 'e'
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 42eebcb..16be190 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -511,7 +511,7 @@ class RhnRepo(YumRepository):
import yum.Errors
try:
return YumRepository._getRepoXML(self)
- except yum.Errors.RepoError, e:
+ except yum.Errors.RepoError:
# Refresh our loginInfo then try again
# possibly it's out of date
up2dateAuth.updateLoginInfo()
commit 27eb06015b97d8615fbd7dcd45a06dbfc14d8f28
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:35:21 2011 +0200
W:689:getRHNRepoOptions: Unused variable 'e'
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 6c0d633..42eebcb 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -687,7 +687,7 @@ def getRHNRepoOptions(conduit, repoid):
if conduit:
if hasattr(conduit, "_conf") and hasattr(conduit._conf,
"items"):
return conduit._conf.items(repoid)
- except NoSectionError, e:
+ except NoSectionError:
pass
return None
commit 1e4827c0fc2176b381c03ee2ae2ffe3bdfc7cfd5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:31:18 2011 +0200
C:491:RhnRepo._setChannelEnable: Operator not followed by a space
print >>f, cfg
^
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 21e9572..6c0d633 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -490,7 +490,7 @@ class RhnRepo(YumRepository):
func = getattr(cfg, self.label)
func.enabled = value
f = open('/etc/yum/pluginconf.d/rhnplugin.conf', 'w')
- print >>f, cfg
+ print >> f, cfg
f.close()
def enablePersistent(self):
commit e2b9e31b72e91161ca06216844d35c763304a097
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:30:28 2011 +0200
RhnRepo._setChannelEnable: Operator not preceded by a space
addressing pylint warnings:
C:488:RhnRepo._setChannelEnable: Operator not preceded by a space
func=getattr(cfg, self.label)
^
C:489:RhnRepo._setChannelEnable: Operator not preceded by a space
func.enabled=value
^
C:490:RhnRepo._setChannelEnable: Operator not preceded by a space
f=open('/etc/yum/pluginconf.d/rhnplugin.conf', 'w')
^
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 7380900..21e9572 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -487,9 +487,9 @@ class RhnRepo(YumRepository):
cfg = INIConfig(file('/etc/yum/pluginconf.d/rhnplugin.conf'))
# we cannot use directly cfg[channel].['enabled'], because
# if that section do not exist it raise error
- func=getattr(cfg, self.label)
- func.enabled=value
- f=open('/etc/yum/pluginconf.d/rhnplugin.conf', 'w')
+ func = getattr(cfg, self.label)
+ func.enabled = value
+ f = open('/etc/yum/pluginconf.d/rhnplugin.conf', 'w')
print >>f, cfg
f.close()
commit 17ba07c996a2fa2598a7292de4eefe64a8448127
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:28:56 2011 +0200
C:225:rewordError: Missing docstring
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 983f0cb..7380900 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -224,9 +224,10 @@ def posttrans_hook(conduit):
str(e))
def rewordError(e):
- #This is compensating for hosted/satellite returning back an error
- #message instructing RHEL5 clients to run "rhn_register"
- #bz: 438175
+ """ This is compensating for hosted/satellite returning back an error
+ message instructing RHEL5 clients to run "rhn_register"
+ bz: 438175
+ """
replacedText = _("Error Message:") + "\n\t" + \
_("Please run rhn_register as root on this client")
index = e.errmsg.find(": 9\n")
commit 41e60fa98a0556fe553dc3f023abda8ae39d94ae
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:24:25 2011 +0200
W:109:prereposetup_hook: Unused variable 'proxy_dict'
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 6dd2f60..983f0cb 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -104,9 +104,9 @@ def prereposetup_hook(conduit):
return
up2date_cfg = config.initUp2dateConfig()
+ proxy_dict = {}
try:
proxy_url = get_proxy_url(up2date_cfg)
- proxy_dict = {}
if up2date_cfg['useNoSSLForPackages']:
proxy_dict = {'HTTP' : proxy_url}
else:
@@ -181,6 +181,7 @@ def prereposetup_hook(conduit):
repo.sslcacert = sslcacert
repo.enablegroups = enablegroups
repo.metadata_expire = metadata_expire
+ repo.proxy_dict = proxy_dict
if hasattr(conduit.getConf(), '_repos_persistdir'):
repo.base_persistdir = conduit.getConf()._repos_persistdir
repoOptions = getRHNRepoOptions(conduit, repo.id)
commit 5dca6e6589615b04730c577cd3ee3bbb46b8d61d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:18:25 2011 +0200
W: 22: No exception type(s) specified
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index a02528a..6dd2f60 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -18,7 +18,7 @@ from urlgrabber.grabber import URLGrabber
from urlgrabber.grabber import URLGrabError
try:
from urlgrabber.grabber import pycurl
-except:
+except ImportError:
pycurl = None
from iniparse import INIConfig
commit 43c91a286bed81fdd92156021aee0c729376e7ab
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:15:11 2011 +0200
W:202: Bad indentation.
addressing pylint warnings:
W: 63: Bad indentation. Found 7 spaces, expected 8
W: 64: Bad indentation. Found 7 spaces, expected 8
W: 65: Bad indentation. Found 7 spaces, expected 8
W: 66: Bad indentation. Found 7 spaces, expected 8
W: 67: Bad indentation. Found 11 spaces, expected 12
W: 68: Bad indentation. Found 15 spaces, expected 16
W: 69: Bad indentation. Found 11 spaces, expected 12
W: 70: Bad indentation. Found 11 spaces, expected 12
W: 71: Bad indentation. Found 11 spaces, expected 12
W: 73: Bad indentation. Found 15 spaces, expected 16
W: 74: Bad indentation. Found 15 spaces, expected 16
W: 75: Bad indentation. Found 15 spaces, expected 16
W: 76: Bad indentation. Found 15 spaces, expected 16
W: 77: Bad indentation. Found 15 spaces, expected 16
W: 78: Bad indentation. Found 15 spaces, expected 16
W: 79: Bad indentation. Found 19 spaces, expected 20
W: 80: Bad indentation. Found 15 spaces, expected 16
W: 81: Bad indentation. Found 15 spaces, expected 16
W: 82: Bad indentation. Found 19 spaces, expected 20
W:202: Bad indentation. Found 11 spaces, expected 12
W:203: Bad indentation. Found 15 spaces, expected 16
W:204: Bad indentation. Found 11 spaces, expected 12
W:205: Bad indentation. Found 15 spaces, expected 16
W:267: Bad indentation. Found 10 spaces, expected 12
W:268: Bad indentation. Found 12 spaces, expected 16
W:270: Bad indentation. Found 10 spaces, expected 12
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 1a2bf32..a02528a 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -60,26 +60,26 @@ def init_hook(conduit):
repos = conduit.getRepos()
cachefilename = os.path.join(cachedir, cachedRHNReposFile)
if os.access(cachefilename, os.R_OK):
- cachefile = open(cachefilename, 'r')
- repolist = [ line.rstrip().split(' ', 1) for line in
cachefile.readlines()]
- cachefile.close()
- for repo_item in repolist:
- if len(repo_item) == 1:
- repo_item.append('')
- (repoid, reponame) = repo_item
- repodir = os.path.join(cachedir, repoid)
- if os.path.isdir(repodir) and os.path.isfile(
+ cachefile = open(cachefilename, 'r')
+ repolist = [ line.rstrip().split(' ', 1) for line in
cachefile.readlines()]
+ cachefile.close()
+ for repo_item in repolist:
+ if len(repo_item) == 1:
+ repo_item.append('')
+ (repoid, reponame) = repo_item
+ repodir = os.path.join(cachedir, repoid)
+ if os.path.isdir(repodir) and os.path.isfile(
os.path.join(repodir, 'repodata',
'repomd.xml')):
- repo = YumRepository(repoid)
- repo.basecachedir = cachedir
- repo.baseurl = ['file:///' + repodir ]
- repo.urls = repo.baseurl
- repo.name = reponame
- if hasattr(conduit.getConf(), '_repos_persistdir'):
- repo.base_persistdir = conduit.getConf()._repos_persistdir
- repo.enable()
- if not repos.findRepos(repo.id):
- repos.add(repo)
+ repo = YumRepository(repoid)
+ repo.basecachedir = cachedir
+ repo.baseurl = ['file:///' + repodir ]
+ repo.urls = repo.baseurl
+ repo.name = reponame
+ if hasattr(conduit.getConf(), '_repos_persistdir'):
+ repo.base_persistdir = conduit.getConf()._repos_persistdir
+ repo.enable()
+ if not repos.findRepos(repo.id):
+ repos.add(repo)
def prereposetup_hook(conduit):
"""
@@ -199,10 +199,10 @@ def prereposetup_hook(conduit):
opts = conduit.getCmdLine()[0]
if opts:
for opt, repoexp in opts.repos:
- if opt == '--enablerepo':
- conduit._base.repos.enableRepo(repoexp)
- elif opt == '--disablerepo':
- conduit._base.repos.disableRepo(repoexp)
+ if opt == '--enablerepo':
+ conduit._base.repos.enableRepo(repoexp)
+ elif opt == '--disablerepo':
+ conduit._base.repos.disableRepo(repoexp)
def posttrans_hook(conduit):
@@ -264,10 +264,10 @@ class RhnRepo(YumRepository):
# support failover urls, #232567
urls = []
if type(channel['url']) == list:
- for url in channel['url']:
- urls.append(url + '/GET-REQ/' + self.id)
+ for url in channel['url']:
+ urls.append(url + '/GET-REQ/' + self.id)
else: # type will be always list since Spacewalk 1.4, in future this will be dead
coed
- urls.append(channel['url'] + '/GET-REQ/' + self.id)
+ urls.append(channel['url'] + '/GET-REQ/' + self.id)
self.baseurl = urls
self.urls = self.baseurl
commit a50a4746bfd801e5765dfcff4577261cf63fdd60
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Apr 29 10:12:15 2011 +0200
691283 - create persistdir in _repos_persistdir instead of PWD
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py
b/client/rhel/yum-rhn-plugin/rhnplugin.py
index dc35889..1a2bf32 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -75,6 +75,8 @@ def init_hook(conduit):
repo.baseurl = ['file:///' + repodir ]
repo.urls = repo.baseurl
repo.name = reponame
+ if hasattr(conduit.getConf(), '_repos_persistdir'):
+ repo.base_persistdir = conduit.getConf()._repos_persistdir
repo.enable()
if not repos.findRepos(repo.id):
repos.add(repo)