[2018.3] Fix some pylint issues that have popped up recently

This commit is contained in:
rallytime 2018-10-15 13:29:54 -04:00
parent fef7669a15
commit e73f13d766
No known key found for this signature in database
GPG Key ID: E8F1A4B90D0DEA19
4 changed files with 6 additions and 8 deletions

View File

@ -593,7 +593,7 @@ class SlackClient(object):
Run each of them through ``get_configured_target(('foo', f), 'pillar.get')`` and confirm a valid target
'''
# Default to targetting all minions with a type of glob
# Default to targeting all minions with a type of glob
null_target = {'target': '*', 'tgt_type': 'glob'}
def check_cmd_against_group(cmd):
@ -627,14 +627,12 @@ class SlackClient(object):
return checked
return null_target
# emulate the yaml_out output formatter. It relies on a global __opts__ object which we can't
# obviously pass in
def format_return_text(self, data, function, **kwargs): # pylint: disable=unused-argument
'''
Print out YAML using the block mode
'''
# emulate the yaml_out output formatter. It relies on a global __opts__ object which
# we can't obviously pass in
try:
# Format results from state runs with highstate output
if function.startswith('state'):

View File

@ -214,7 +214,7 @@ def get(consul_url=None, key=None, token=None, recurse=False, decode=False, raw=
if ret['res']:
if decode:
for item in ret['data']:
if item['Value'] != None:
if item['Value'] is not None:
item['Value'] = base64.b64decode(item['Value'])
else:
item['Value'] = ""

View File

@ -4689,7 +4689,7 @@ def get_pid(name, path=None):
if name not in list_(limit='running', path=path):
raise CommandExecutionError('Container {0} is not running, can\'t determine PID'.format(name))
info = __salt__['cmd.run']('lxc-info -n {0}'.format(name)).split("\n")
pid = [line.split(':')[1].strip() for line in info if re.match(r'\s*PID', line) != None][0]
pid = [line.split(':')[1].strip() for line in info if re.match(r'\s*PID', line) is not None][0]
return pid

View File

@ -4337,7 +4337,7 @@ def _writeAdminTemplateRegPolFile(admtemplate_data,
adml_policy_resources=None,
display_language='en-US',
registry_class='Machine'):
u'''
r'''
helper function to prep/write adm template data to the Registry.pol file
each file begins with REGFILE_SIGNATURE (u'\u5250\u6765') and