commit:     9046d7d5b557cb94bcd6a3b4df0c6f4245f9ffa4
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 13 02:17:10 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Feb 13 02:17:10 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9046d7d5

portage/sync: Fix Syncbase _has_bin() bug 539706

self.logger.ERROR should have been logging.ERROR.  I mistakenly converted it to 
self.logger from logging during initial coding.
Rename _has_bin, back to has_bin since there is no need for it to be called 
after _kwargs() to have self.logger defined.

---
 pym/portage/sync/modules/webrsync/webrsync.py | 2 +-
 pym/portage/sync/syncbase.py                  | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pym/portage/sync/modules/webrsync/webrsync.py 
b/pym/portage/sync/modules/webrsync/webrsync.py
index c6dcd42..b22a2a4 100644
--- a/pym/portage/sync/modules/webrsync/webrsync.py
+++ b/pym/portage/sync/modules/webrsync/webrsync.py
@@ -32,7 +32,7 @@ class WebRsync(SyncBase):
                if kwargs:
                        self._kwargs(kwargs)
 
-               if not self._has_bin:
+               if not self.has_bin:
                        return (1, False)
 
                exitcode = portage.process.spawn_bash("%s" % \

diff --git a/pym/portage/sync/syncbase.py b/pym/portage/sync/syncbase.py
index 229927f..d30d69d 100644
--- a/pym/portage/sync/syncbase.py
+++ b/pym/portage/sync/syncbase.py
@@ -7,6 +7,7 @@ This class contains common initialization code and functions.
 '''
 
 
+import logging
 import os
 
 import portage
@@ -42,7 +43,7 @@ class SyncBase(object):
 
 
        @property
-       def _has_bin(self):
+       def has_bin(self):
                '''Checks for existance of the external binary.
 
                MUST only be called after _kwargs() has set the logger
@@ -53,7 +54,7 @@ class SyncBase(object):
                        % (self.bin_pkg, self._bin_command)]
                        for l in msg:
                                writemsg_level("!!! %s\n" % l,
-                                       level=self.logger.ERROR, noiselevel=-1)
+                                       level=logging.ERROR, noiselevel=-1)
                        return False
                return True
 
@@ -116,7 +117,7 @@ class NewBase(SyncBase):
                if kwargs:
                        self._kwargs(kwargs)
 
-               if not self._has_bin:
+               if not self.has_bin:
                        return (1, False)
 
                if not self.exists():

Reply via email to