Add missing space after keywords. (#78480)

Also remove unnecessary parenthesis.
pull/78483/head
Matt Clay 2 years ago committed by GitHub
parent 04e8927579
commit 650befed37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,7 +90,7 @@ def main(args):
data = json.load(src, strict=False) data = json.load(src, strict=False)
docs = get_all_items(data) docs = get_all_items(data)
if 'invocation' in docs: if 'invocation' in docs:
del(docs['invocation']) del docs['invocation']
print(yaml.safe_dump(docs, default_flow_style=False)) print(yaml.safe_dump(docs, default_flow_style=False))

@ -455,8 +455,8 @@ class CLI(ABC):
try: try:
options = self.parser.parse_args(self.args[1:]) options = self.parser.parse_args(self.args[1:])
except SystemExit as e: except SystemExit as ex:
if(e.code != 0): if ex.code != 0:
self.parser.exit(status=2, message=" \n%s" % self.parser.format_help()) self.parser.exit(status=2, message=" \n%s" % self.parser.format_help())
raise raise
options = self.post_process_args(options) options = self.post_process_args(options)

@ -1069,7 +1069,7 @@ class TaskExecutor:
task_keys['password'] = self._play_context.password task_keys['password'] = self._play_context.password
# Prevent task retries from overriding connection retries # Prevent task retries from overriding connection retries
del(task_keys['retries']) del task_keys['retries']
# set options with 'templated vars' specific to this plugin and dependent ones # set options with 'templated vars' specific to this plugin and dependent ones
self._connection.set_options(task_keys=task_keys, var_options=options) self._connection.set_options(task_keys=task_keys, var_options=options)

@ -469,7 +469,7 @@ def copy_left_only(src, dest, module):
b_dest_item_path = to_bytes(dest_item_path, errors='surrogate_or_strict') b_dest_item_path = to_bytes(dest_item_path, errors='surrogate_or_strict')
if os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path) and local_follow is True: if os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path) and local_follow is True:
shutil.copytree(b_src_item_path, b_dest_item_path, symlinks=not(local_follow)) shutil.copytree(b_src_item_path, b_dest_item_path, symlinks=not local_follow)
chown_recursive(b_dest_item_path, module) chown_recursive(b_dest_item_path, module)
if os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path) and local_follow is False: if os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path) and local_follow is False:
@ -497,7 +497,7 @@ def copy_left_only(src, dest, module):
module.set_group_if_different(b_dest_item_path, group, False) module.set_group_if_different(b_dest_item_path, group, False)
if not os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path): if not os.path.islink(b_src_item_path) and os.path.isdir(b_src_item_path):
shutil.copytree(b_src_item_path, b_dest_item_path, symlinks=not(local_follow)) shutil.copytree(b_src_item_path, b_dest_item_path, symlinks=not local_follow)
chown_recursive(b_dest_item_path, module) chown_recursive(b_dest_item_path, module)
changed = True changed = True
@ -766,7 +766,7 @@ def main():
b_dest = to_bytes(os.path.join(b_dest, b_basename), errors='surrogate_or_strict') b_dest = to_bytes(os.path.join(b_dest, b_basename), errors='surrogate_or_strict')
b_src = to_bytes(os.path.join(module.params['src'], ""), errors='surrogate_or_strict') b_src = to_bytes(os.path.join(module.params['src'], ""), errors='surrogate_or_strict')
if not module.check_mode: if not module.check_mode:
shutil.copytree(b_src, b_dest, symlinks=not(local_follow)) shutil.copytree(b_src, b_dest, symlinks=not local_follow)
chown_recursive(dest, module) chown_recursive(dest, module)
changed = True changed = True
@ -775,7 +775,7 @@ def main():
b_dest = to_bytes(os.path.join(b_dest, b_basename), errors='surrogate_or_strict') b_dest = to_bytes(os.path.join(b_dest, b_basename), errors='surrogate_or_strict')
b_src = to_bytes(os.path.join(module.params['src'], ""), errors='surrogate_or_strict') b_src = to_bytes(os.path.join(module.params['src'], ""), errors='surrogate_or_strict')
if not module.check_mode and not os.path.exists(b_dest): if not module.check_mode and not os.path.exists(b_dest):
shutil.copytree(b_src, b_dest, symlinks=not(local_follow)) shutil.copytree(b_src, b_dest, symlinks=not local_follow)
changed = True changed = True
chown_recursive(dest, module) chown_recursive(dest, module)
if module.check_mode and not os.path.exists(b_dest): if module.check_mode and not os.path.exists(b_dest):

@ -468,7 +468,7 @@ def main():
depth = int(fsname.count(os.path.sep)) - int(wpath.count(os.path.sep)) + 1 depth = int(fsname.count(os.path.sep)) - int(wpath.count(os.path.sep)) + 1
if depth > params['depth']: if depth > params['depth']:
# Empty the list used by os.walk to avoid traversing deeper unnecessarily # Empty the list used by os.walk to avoid traversing deeper unnecessarily
del(dirs[:]) del dirs[:]
continue continue
if os.path.basename(fsname).startswith('.') and not params['hidden']: if os.path.basename(fsname).startswith('.') and not params['hidden']:
continue continue

@ -21,4 +21,4 @@ class CallbackModule(CallbackBase):
def __getattr__(self, name): def __getattr__(self, name):
if name.startswith('v2_'): if name.startswith('v2_'):
return(lambda *args, **kwargs: self._display.display(name)) return lambda *args, **kwargs: self._display.display(name)

@ -15,7 +15,7 @@ throttledir = os.path.expanduser(throttledir)
throttlefile = os.path.join(throttledir, inventory_hostname) throttlefile = os.path.join(throttledir, inventory_hostname)
try: try:
# create the file # create the file
with(open(throttlefile, 'a')): with open(throttlefile, 'a'):
os.utime(throttlefile, None) os.utime(throttlefile, None)
# count the number of files in the dir # count the number of files in the dir
throttlelist = os.listdir(throttledir) throttlelist = os.listdir(throttledir)

Loading…
Cancel
Save