Pushed. Thanks!
On Monday 15 of April 2013 16:36:49 Denys Vlasenko wrote:
One error path was returning nothing - the caller doesn't expect
it.
Return RETURN_FAILURE instead.
Another error path was just exiting (and using non-standard logging):
converted to RETURN_FAILURE.
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/client-python/debuginfo.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/client-python/debuginfo.py b/src/client-python/debuginfo.py
index 4d215ad..542175e 100644
--- a/src/client-python/debuginfo.py
+++ b/src/client-python/debuginfo.py
@@ -215,7 +215,7 @@ class DebugInfoDownload(YumBase):
downloaded_pkgs = 0
# nothing to download?
if not files:
- return
+ return RETURN_FAILURE
#if verbose == 0:
# # this suppress yum messages about setting up repositories
@@ -223,8 +223,8 @@ class DebugInfoDownload(YumBase):
# make yumdownloader work as non root user
if not self.setCacheDir():
- self.logger.error("Error: can't make cachedir, exiting")
- exit(50)
+ print _("Error: can't make cachedir, exiting")
+ return RETURN_FAILURE
# disable all not needed
for repo in self.repos.listEnabled():
@@ -245,9 +245,9 @@ class DebugInfoDownload(YumBase):
self.repos.doSetup(thisrepo=str(r.id))
log1("enabled repo %s", rid)
setattr(r, "skip_if_unavailable", True)
- # yes, we want async download otherwise our
progressCallback - # is not called and the interanl yum is
used, which cause - # artifacts in output
+ # yes, we want async download, otherwise our
progressCallback + # is not called and the internal yum's
one is used, + # which causes artifacts on output
try:
setattr(r, "_async", False)
except Exception, ex: