mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
PEP 8 E111 & E114 cleanup. (#20838)
This commit is contained in:
@@ -231,16 +231,16 @@ def contentfilter(fsname, pattern):
|
||||
return True
|
||||
|
||||
try:
|
||||
f = open(fsname)
|
||||
prog = re.compile(pattern)
|
||||
for line in f:
|
||||
if prog.match (line):
|
||||
f.close()
|
||||
return True
|
||||
f = open(fsname)
|
||||
prog = re.compile(pattern)
|
||||
for line in f:
|
||||
if prog.match (line):
|
||||
f.close()
|
||||
return True
|
||||
|
||||
f.close()
|
||||
f.close()
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
|
||||
return False
|
||||
|
||||
@@ -337,7 +337,7 @@ def main():
|
||||
fsname=os.path.normpath(os.path.join(root, fsobj))
|
||||
|
||||
if os.path.basename(fsname).startswith('.') and not params['hidden']:
|
||||
continue
|
||||
continue
|
||||
|
||||
try:
|
||||
st = os.lstat(fsname)
|
||||
|
||||
@@ -134,17 +134,17 @@ from ansible.module_utils.basic import AnsibleModule
|
||||
# match_opt
|
||||
|
||||
def match_opt(option, line):
|
||||
option = re.escape(option)
|
||||
return re.match(' *%s( |\t)*=' % option, line) \
|
||||
or re.match('# *%s( |\t)*=' % option, line) \
|
||||
or re.match('; *%s( |\t)*=' % option, line)
|
||||
option = re.escape(option)
|
||||
return re.match(' *%s( |\t)*=' % option, line) \
|
||||
or re.match('# *%s( |\t)*=' % option, line) \
|
||||
or re.match('; *%s( |\t)*=' % option, line)
|
||||
|
||||
# ==============================================================
|
||||
# match_active_opt
|
||||
|
||||
def match_active_opt(option, line):
|
||||
option = re.escape(option)
|
||||
return re.match(' *%s( |\t)*=' % option, line)
|
||||
option = re.escape(option)
|
||||
return re.match(' *%s( |\t)*=' % option, line)
|
||||
|
||||
# ==============================================================
|
||||
# do_ini
|
||||
|
||||
@@ -443,10 +443,10 @@ def main():
|
||||
ssh_opts = '-S none'
|
||||
|
||||
if not verify_host:
|
||||
ssh_opts = '%s -o StrictHostKeyChecking=no' % ssh_opts
|
||||
ssh_opts = '%s -o StrictHostKeyChecking=no' % ssh_opts
|
||||
|
||||
if ssh_args:
|
||||
ssh_opts = '%s %s' % (ssh_opts, ssh_args)
|
||||
ssh_opts = '%s %s' % (ssh_opts, ssh_args)
|
||||
|
||||
if source.startswith('"rsync://') and dest.startswith('"rsync://'):
|
||||
module.fail_json(msg='either src or dest must be a localhost', rc=1)
|
||||
|
||||
@@ -591,7 +591,7 @@ class TgzArchive(object):
|
||||
self.opts = module.params['extra_opts']
|
||||
self.module = module
|
||||
if self.module.check_mode:
|
||||
self.module.exit_json(skipped=True, msg="remote module (%s) does not support check mode when using gtar" % self.module._name)
|
||||
self.module.exit_json(skipped=True, msg="remote module (%s) does not support check mode when using gtar" % self.module._name)
|
||||
self.excludes = [ path.rstrip('/') for path in self.module.params['exclude']]
|
||||
# Prefer gtar (GNU tar) as it supports the compression options -z, -j and -J
|
||||
self.cmd_path = self.module.get_bin_path('gtar', None)
|
||||
|
||||
Reference in New Issue
Block a user