mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
Add missing space after keywords. (#78480)
Also remove unnecessary parenthesis.
This commit is contained in:
@@ -90,7 +90,7 @@ def main(args):
|
||||
data = json.load(src, strict=False)
|
||||
docs = get_all_items(data)
|
||||
if 'invocation' in docs:
|
||||
del(docs['invocation'])
|
||||
del docs['invocation']
|
||||
print(yaml.safe_dump(docs, default_flow_style=False))
|
||||
|
||||
|
||||
|
||||
@@ -455,8 +455,8 @@ class CLI(ABC):
|
||||
|
||||
try:
|
||||
options = self.parser.parse_args(self.args[1:])
|
||||
except SystemExit as e:
|
||||
if(e.code != 0):
|
||||
except SystemExit as ex:
|
||||
if ex.code != 0:
|
||||
self.parser.exit(status=2, message=" \n%s" % self.parser.format_help())
|
||||
raise
|
||||
options = self.post_process_args(options)
|
||||
|
||||
@@ -1069,7 +1069,7 @@ class TaskExecutor:
|
||||
task_keys['password'] = self._play_context.password
|
||||
|
||||
# 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
|
||||
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')
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
changed = True
|
||||
@@ -766,7 +766,7 @@ def main():
|
||||
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')
|
||||
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)
|
||||
changed = True
|
||||
|
||||
@@ -775,7 +775,7 @@ def main():
|
||||
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')
|
||||
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
|
||||
chown_recursive(dest, module)
|
||||
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
|
||||
if depth > params['depth']:
|
||||
# Empty the list used by os.walk to avoid traversing deeper unnecessarily
|
||||
del(dirs[:])
|
||||
del dirs[:]
|
||||
continue
|
||||
if os.path.basename(fsname).startswith('.') and not params['hidden']:
|
||||
continue
|
||||
|
||||
@@ -229,7 +229,7 @@ def split_args(args):
|
||||
# to the end of the list, since we'll tack on more to it later
|
||||
# otherwise, if we're inside any jinja2 block, inside quotes, or we were
|
||||
# inside quotes (but aren't now) concat this token to the last param
|
||||
if inside_quotes and not was_inside_quotes and not(print_depth or block_depth or comment_depth):
|
||||
if inside_quotes and not was_inside_quotes and not (print_depth or block_depth or comment_depth):
|
||||
params.append(token)
|
||||
appended = True
|
||||
elif print_depth or block_depth or comment_depth or inside_quotes or was_inside_quotes:
|
||||
|
||||
@@ -286,7 +286,7 @@ class ActionModule(ActionBase):
|
||||
finally:
|
||||
# cleanup and save some information
|
||||
# restore the old settings for the duped stdin stdin_fd
|
||||
if not(None in (stdin_fd, old_settings)) and isatty(stdin_fd):
|
||||
if not (None in (stdin_fd, old_settings)) and isatty(stdin_fd):
|
||||
termios.tcsetattr(stdin_fd, termios.TCSADRAIN, old_settings)
|
||||
|
||||
duration = time.time() - start
|
||||
|
||||
@@ -21,4 +21,4 @@ class CallbackModule(CallbackBase):
|
||||
|
||||
def __getattr__(self, name):
|
||||
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)
|
||||
try:
|
||||
# create the file
|
||||
with(open(throttlefile, 'a')):
|
||||
with open(throttlefile, 'a'):
|
||||
os.utime(throttlefile, None)
|
||||
# count the number of files in the dir
|
||||
throttlelist = os.listdir(throttledir)
|
||||
|
||||
@@ -72,7 +72,7 @@ class CollectionLayout(LayoutProvider):
|
||||
unit_module_path='tests/unit/plugins/modules',
|
||||
unit_module_utils_path='tests/unit/plugins/module_utils',
|
||||
unit_messages=unit_messages,
|
||||
unsupported=not(is_valid_identifier(collection_namespace) and is_valid_identifier(collection_name)),
|
||||
unsupported=not (is_valid_identifier(collection_namespace) and is_valid_identifier(collection_name)),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user