1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ansible/executor: PEP8 compliancy (#24695)

- Make PEP8 compliant
This commit is contained in:
Dag Wieers 2017-05-30 19:13:53 +02:00 committed by John R Barker
parent 51b595992b
commit 630185cb20
11 changed files with 134 additions and 149 deletions

View file

@ -18,4 +18,3 @@
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

View file

@ -40,4 +40,3 @@ if 'action_write_locks' not in globals():
mods.update(('copy', 'file', 'setup', 'slurp', 'stat'))
for mod_name in mods:
action_write_locks[mod_name] = Lock()

View file

@ -837,6 +837,7 @@ def modify_module(module_name, module_path, module_args, task_vars=dict(), modul
return (b_module_data, module_style, to_text(shebang, nonstring='passthru'))
def build_windows_module_payload(module_name, module_path, b_module_data, module_args, task_vars, task, play_context, environment):
exec_manifest = dict(
module_entry=to_text(base64.b64encode(b_module_data)),

View file

@ -130,6 +130,7 @@ class HostState:
new_state.always_child_state = self.always_child_state.copy()
return new_state
class PlayIterator:
# the primary running states for the play iteration
@ -270,7 +271,6 @@ class PlayIterator:
display.debug(" ^ state is: %s" % s)
return (s, task)
def _get_next_task_from_state(self, state, host, peek, in_child=False):
task = None
@ -567,4 +567,3 @@ class PlayIterator:
for b in task_list:
self.cache_block_tasks(b)
self._host_states[host.name] = self._insert_tasks_into_state(self.get_host_state(host), task_list)

View file

@ -18,4 +18,3 @@
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

View file

@ -167,4 +167,3 @@ class WorkerProcess(multiprocessing.Process):
# ps.print_stats()
# with open('worker_%06d.stats' % os.getpid(), 'w') as f:
# f.write(s.getvalue())

View file

@ -23,6 +23,7 @@ from collections import MutableMapping
from ansible.utils.vars import merge_hash
class AggregateStats:
''' holds stats about per-host activity during playbook runs '''
@ -53,7 +54,7 @@ class AggregateStats:
failures=self.failures.get(host, 0),
unreachable=self.dark.get(host, 0),
changed=self.changed.get(host, 0),
skipped = self.skipped.get(host, 0)
skipped=self.skipped.get(host, 0),
)
def set_custom_stats(self, which, what, host=None):
@ -83,4 +84,3 @@ class AggregateStats:
else:
# let overloaded + take care of other types
self.custom[host][which] += what

View file

@ -148,7 +148,7 @@ class TaskExecutor:
else:
raise
elif isinstance(res, list):
for idx,item in enumerate(res):
for (idx, item) in enumerate(res):
res[idx] = _clean_res(item, errors=errors)
return res
@ -189,7 +189,6 @@ class TaskExecutor:
# get search path for this task to pass to lookup plugins
self._job_vars['ansible_search_path'] = self._task.get_search_path()
templar = Templar(loader=self._loader, shared_loader_obj=self._shared_loader_obj, variables=self._job_vars)
items = None
if self._task.loop:

View file

@ -332,7 +332,7 @@ class TaskQueueManager:
# <WorkerProcess(WorkerProcess-2, stopped[SIGTERM])>
defunct = False
for idx,x in enumerate(self._workers):
for (idx, x) in enumerate(self._workers):
if hasattr(x[0], 'exitcode'):
if x[0].exitcode in [-9, -11, -15]:
defunct = True

View file

@ -10,20 +10,10 @@ lib/ansible/cli/playbook.py
lib/ansible/cli/pull.py
lib/ansible/cli/vault.py
lib/ansible/constants.py
lib/ansible/executor/__init__.py
lib/ansible/executor/action_write_locks.py
lib/ansible/executor/module_common.py
lib/ansible/executor/play_iterator.py
lib/ansible/executor/playbook_executor.py
lib/ansible/executor/process/__init__.py
lib/ansible/executor/process/worker.py
lib/ansible/executor/stats.py
lib/ansible/executor/task_executor.py
lib/ansible/executor/task_queue_manager.py
lib/ansible/inventory/manager.py
lib/ansible/inventory/data.py
lib/ansible/inventory/group.py
lib/ansible/inventory/host.py
lib/ansible/inventory/manager.py
lib/ansible/module_utils/_text.py
lib/ansible/module_utils/a10.py
lib/ansible/module_utils/ansible_tower.py