mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
PEP 8 whitespace cleanup. (#20783)
* PEP 8 E271 whitespace cleanup. * PEP 8 W293 whitespace cleanup. * Fix whitespace issue from recent PR.
This commit is contained in:
parent
802fbcadf8
commit
95789f3949
132 changed files with 287 additions and 313 deletions
|
@ -51,7 +51,7 @@ class ActionModule(ActionBase):
|
|||
if module == 'auto':
|
||||
facts = self._execute_module(module_name='setup', module_args=dict(filter='ansible_pkg_mgr', gather_subset='!all'), task_vars=task_vars)
|
||||
display.debug("Facts %s" % facts)
|
||||
if 'ansible_facts' in facts and 'ansible_pkg_mgr' in facts['ansible_facts']:
|
||||
if 'ansible_facts' in facts and 'ansible_pkg_mgr' in facts['ansible_facts']:
|
||||
module = getattr(facts['ansible_facts'], 'ansible_pkg_mgr', 'auto')
|
||||
|
||||
if module != 'auto':
|
||||
|
|
|
@ -50,7 +50,7 @@ class ActionModule(ActionBase):
|
|||
if module == 'auto':
|
||||
facts = self._execute_module(module_name='setup', module_args=dict(gather_subset='!all', filter='ansible_service_mgr'), task_vars=task_vars)
|
||||
self._display.debug("Facts %s" % facts)
|
||||
if 'ansible_facts' in facts and 'ansible_service_mgr' in facts['ansible_facts']:
|
||||
if 'ansible_facts' in facts and 'ansible_service_mgr' in facts['ansible_facts']:
|
||||
module = facts['ansible_facts']['ansible_service_mgr']
|
||||
|
||||
if not module or module == 'auto' or module not in self._shared_loader_obj.module_loader:
|
||||
|
|
|
@ -66,7 +66,7 @@ class CallbackModule(CallbackBase):
|
|||
def v2_runner_on_ok(self, result):
|
||||
self._clean_results(result._result, result._task.action)
|
||||
self.debug = self._dump_results(result._result)
|
||||
|
||||
|
||||
def v2_playbook_on_task_start(self, task, is_conditional):
|
||||
self.task = task
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class CallbackModule(CallbackBase):
|
|||
make sure you have in ansible.cfg:
|
||||
callback_plugins = <path_to_callback_plugins_folder>
|
||||
and put the plugin in <path_to_callback_plugins_folder>
|
||||
|
||||
|
||||
This plugin makes use of the following environment variables:
|
||||
SYSLOG_SERVER (optional): defaults to localhost
|
||||
SYSLOG_PORT (optional): defaults to 514
|
||||
|
|
|
@ -56,7 +56,7 @@ class Connection(Jail):
|
|||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
|
||||
|
||||
stdout, stderr = p.communicate()
|
||||
# otherwise p.returncode would not be set
|
||||
p.wait()
|
||||
|
|
|
@ -47,7 +47,7 @@ __metaclass__ = type
|
|||
# /tmp/staging/foo
|
||||
# ${inventory_hostname}
|
||||
# bar
|
||||
|
||||
|
||||
# - name: copy first existing file found to /some/file
|
||||
# action: copy src=$item dest=/some/file
|
||||
# with_first_found:
|
||||
|
|
|
@ -48,11 +48,11 @@ class HashiVault:
|
|||
raise AnsibleError("Please pip install hvac to use this module")
|
||||
|
||||
self.url = kwargs.get('url', ANSIBLE_HASHI_VAULT_ADDR)
|
||||
|
||||
|
||||
self.token = kwargs.get('token')
|
||||
if self.token==None:
|
||||
raise AnsibleError("No Vault Token specified")
|
||||
|
||||
|
||||
# split secret arg, which has format 'secret/hello:value' into secret='secret/hello' and secret_field='value'
|
||||
s = kwargs.get('secret')
|
||||
if s==None:
|
||||
|
@ -76,13 +76,13 @@ class HashiVault:
|
|||
data = self.client.read(self.secret)
|
||||
if data is None:
|
||||
raise AnsibleError("The secret %s doesn't seem to exist" % self.secret)
|
||||
|
||||
|
||||
if self.secret_field=='': # secret was specified with trailing ':'
|
||||
return data['data']
|
||||
|
||||
|
||||
if self.secret_field not in data['data']:
|
||||
raise AnsibleError("The secret %s does not contain the field '%s'. " % (self.secret, self.secret_field))
|
||||
|
||||
|
||||
return data['data'][self.secret_field]
|
||||
|
||||
|
||||
|
@ -105,6 +105,6 @@ class LookupModule(LookupBase):
|
|||
key = term.split()[0]
|
||||
value = vault_conn.get()
|
||||
ret.append(value)
|
||||
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ class StrategyBase:
|
|||
# get the original host and task. We then assign them to the TaskResult for use in callbacks/etc.
|
||||
original_host = get_original_host(task_result._host)
|
||||
original_task = iterator.get_original_task(original_host, task_result._task)
|
||||
|
||||
|
||||
task_result._host = original_host
|
||||
task_result._task = original_task
|
||||
|
||||
|
@ -662,7 +662,7 @@ class StrategyBase:
|
|||
if group_name not in host.get_groups():
|
||||
new_group.add_host(real_host)
|
||||
changed = True
|
||||
|
||||
|
||||
if changed:
|
||||
# clear cache of group dict, which is used in magic host variables
|
||||
self._inventory.clear_group_dict_cache()
|
||||
|
@ -899,7 +899,7 @@ class StrategyBase:
|
|||
elif meta_action == 'end_play':
|
||||
if _evaluate_conditional(target_host):
|
||||
for host in self._inventory.get_hosts(iterator._play.hosts):
|
||||
if not host.name in self._tqm._unreachable_hosts:
|
||||
if not host.name in self._tqm._unreachable_hosts:
|
||||
iterator._host_states[host.name].run_state = iterator.ITERATING_COMPLETE
|
||||
msg="ending play"
|
||||
#elif meta_action == 'reset_connection':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue