Merge pull request #22927 from jfindlay/merge_22922

[develop] lint fixes
This commit is contained in:
Justin Findlay 2015-04-21 22:19:36 -06:00
commit a0e253df95
7 changed files with 17 additions and 15 deletions

View File

@ -106,6 +106,7 @@ disable=R,
F0220,
F0401,
E8501,
E8116,
E8121,
E8122,
E8123,
@ -155,6 +156,7 @@ disable=R,
# W1202 (logging-format-interpolation) Use % formatting in logging functions but pass the % parameters as arguments
# W1307 (invalid-format-index) Using invalid lookup key '%s' in format specifier "0['%s']"
#
# E8116 PEP8 E116: unexpected indentation (comment)
# E812* All PEP8 E12*
# E8265 PEP8 E265 - block comment should start with "# "
# E8266 PEP8 E266 - too many leading '#' for block comment

View File

@ -49,7 +49,7 @@ Walkthrough <tutorial-gitfs>`.
# Import python libs
from __future__ import absolute_import
import copy
import distutils.version # pylint: disable=E0611
import distutils.version # pylint: disable=import-error,no-name-in-module
import errno
import fnmatch
import glob

View File

@ -210,7 +210,7 @@ __docformat__ = 'restructuredtext en'
# Import Python libs
import bz2
import copy
import distutils.version # pylint: disable=E0611
import distutils.version # pylint: disable=import-error,no-name-in-module
import fnmatch
import functools
import gzip

View File

@ -83,7 +83,7 @@ def splay(*args, **kwargs):
# Get rid of the hidden kwargs that salt injects
func_kwargs = dict((k, v) for k, v in kwargs.iteritems() if not k.startswith('__'))
result = __salt__[func](*args, **func_kwargs)
if type(result) != dict:
if not isinstance(result, dict):
result = {'result': result}
result['splaytime'] = str(my_delay)
return result
@ -100,7 +100,7 @@ def show(splaytime=_DEFAULT_SPLAYTIME):
salt example-host splay.show 60
'''
# Coerce splaytime to int (passed arg from CLI will be a str)
if type(splaytime) != int:
if not isinstance(splaytime, int):
splaytime = int(splaytime)
return str(_calc_splay(__grains__['id'], splaytime=splaytime))

View File

@ -313,9 +313,9 @@ def renderer_doc(*args):
for module in args:
if '*' in module:
for fun in fnmatch.filter(renderers_.keys(), module): # pylint: disable=incompatible-py3-code
docs[fun] = renderers_[fun].__doc__ # There's no problem feeding fnmatch.filter()
# with a Py3's dict_keys() instance
for fun in fnmatch.filter(renderers_.keys(), module): # pylint: disable=incompatible-py3-code
docs[fun] = renderers_[fun].__doc__ # There's no problem feeding fnmatch.filter()
# with a Py3's dict_keys() instance
else:
for fun in six.iterkeys(renderers_):
docs[fun] = renderers_[fun].__doc__

View File

@ -39,9 +39,9 @@ class CopyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
if not line:
continue
data = yaml.load(line)
minions.extend(data.keys()) # pylint: disable=incompatible-py3-code
# since we're extending a list, the Py3 dict_keys view will behave
# as expected.
minions.extend(data.keys()) # pylint: disable=incompatible-py3-code
# since we're extending a list, the Py3 dict_keys view will behave
# as expected.
self.assertNotEqual(minions, [])

View File

@ -164,7 +164,7 @@ class ModjkTestCase(TestCase):
self.assertTrue(modjk.bulk_recover(["node1", "node2", "node3"],
'loadbalancer1'))
# 'worker_status' function tests: 1
# 'worker_status' function tests: 1
def test_worker_status(self):
'''
@ -179,7 +179,7 @@ class ModjkTestCase(TestCase):
with patch.object(modjk, '_do_http', return_value={}):
self.assertFalse(modjk.worker_status("node1"))
# 'worker_recover' function tests: 1
# 'worker_recover' function tests: 1
def test_worker_recover(self):
'''
@ -190,7 +190,7 @@ class ModjkTestCase(TestCase):
self.assertDictEqual(modjk.worker_recover("node1", 'loadbalancer1'),
{})
# 'worker_disable' function tests: 1
# 'worker_disable' function tests: 1
def test_worker_disable(self):
'''
@ -200,7 +200,7 @@ class ModjkTestCase(TestCase):
{'worker.result.type': 'OK'}):
self.assertTrue(modjk.worker_disable('node1', 'loadbalancer1'))
# 'worker_activate' function tests: 1
# 'worker_activate' function tests: 1
def test_worker_activate(self):
'''
@ -210,7 +210,7 @@ class ModjkTestCase(TestCase):
{'worker.result.type': 'OK'}):
self.assertTrue(modjk.worker_activate('node1', 'loadbalancer1'))
# 'worker_stop' function tests: 1
# 'worker_stop' function tests: 1
def test_worker_stop(self):
'''