diff --git a/packstack/installer/utils/network.py b/packstack/installer/utils/network.py index 22c2aa5a3..0d12b8bcc 100644 --- a/packstack/installer/utils/network.py +++ b/packstack/installer/utils/network.py @@ -24,7 +24,7 @@ def get_localhost_ip(): nsrvs.append(match.group('ns_ip')) # try to connect to nameservers and return own IP address - nsrvs.append('8.8.8.8') # default to google dns + nsrvs.append('8.8.8.8') # default to google dns for i in nsrvs: try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) diff --git a/packstack/installer/utils/shell.py b/packstack/installer/utils/shell.py index 787a7f496..7bf6fc97e 100644 --- a/packstack/installer/utils/shell.py +++ b/packstack/installer/utils/shell.py @@ -18,9 +18,9 @@ def execute(cmd, workdir=None, can_fail=False, mask_list=None, code. Otherwise """ mask_list = mask_list or [] - repl_list = [("'","'\\''")] + repl_list = [("'", "'\\''")] - if type(cmd) is not types.StringType: + if not isinstance(cmd, types.StringType): import pipes masked = ' '.join((pipes.quote(i) for i in cmd)) else: @@ -58,7 +58,7 @@ class ScriptRunner(object): def execute(self, logerrors=True, maskList=None): maskList = maskList or [] script = "\n".join(self.script) - logging.debug("# ============ ssh : %r =========="%self.ip) + logging.debug("# ============ ssh : %r ==========" % self.ip) _PIPE = subprocess.PIPE # pylint: disable=E1101 if self.ip: @@ -71,7 +71,7 @@ class ScriptRunner(object): stderr=_PIPE, close_fds=True, shell=False) - replace_list = [("'","'\\''")] + replace_list = [("'", "'\\''")] logging.debug(mask_string(script, maskList, replace_list)) script = "function t(){ exit $? ; } \n trap t ERR \n" + script stdoutdata, stderrdata = obj.communicate(script) diff --git a/tox.ini b/tox.ini index f8c66fcce..2b2916823 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,9 @@ downloadcache = ~/cache/pip [testenv:pep8] deps=pep8==1.2 commands = pep8 --exclude=*.pyc --repeat --show-source \ - packstack/modules tests setup.py + packstack/modules tests setup.py packstack/installer/utils \ + packstack/installer/processors.py + [testenv:cover] setenv = NOSE_WITH_COVERAGE=1