Skip to content

Commit

Permalink
PEP 8 indent cleanup. (ansible#20800)
Browse files Browse the repository at this point in the history
* PEP 8 E121 cleanup.

* PEP 8 E126 cleanup.

* PEP 8 E122 cleanup.
  • Loading branch information
mattclay authored and gundalow committed Jan 29, 2017
1 parent 1c6bb4a commit 10d9318
Show file tree
Hide file tree
Showing 244 changed files with 2,874 additions and 2,974 deletions.
2 changes: 1 addition & 1 deletion contrib/inventory/azure_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def __init__(self):
def _parse_cli_args(self):
# Parse command line arguments
parser = argparse.ArgumentParser(
description='Produce an Ansible Inventory file for an Azure subscription')
description='Produce an Ansible Inventory file for an Azure subscription')
parser.add_argument('--list', action='store_true', default=True,
help='List instances (default: True)')
parser.add_argument('--debug', action='store_true', default=False,
Expand Down
4 changes: 2 additions & 2 deletions contrib/inventory/cloudstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def get_list(self, project_id=None, domain_id=None):
group_name = group['name']
if group_name and not group_name in data:
data[group_name] = {
'hosts': []
}
'hosts': []
}

hosts = self.cs.listVirtualMachines(projectid=project_id, domainid=domain_id)
if not hosts:
Expand Down
4 changes: 2 additions & 2 deletions contrib/inventory/consul_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ def load_availability_groups(self, node, datacenter):
ok = 'passing' == check['Status']
if ok:
suffix = self.config.get_availability_suffix(
'available_suffix', '_available')
'available_suffix', '_available')
else:
suffix = self.config.get_availability_suffix(
'unavailable_suffix', '_unavailable')
'unavailable_suffix', '_unavailable')
self.add_node_to_map(self.nodes_by_availability,
service_name + suffix, node['Node'])

Expand Down
30 changes: 15 additions & 15 deletions contrib/inventory/digital_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ def load_from_digital_ocean(self, resource=None):
def build_inventory(self):
'''Build Ansible inventory of droplets'''
self.inventory = {
'all': {
'hosts': [],
'vars': self.group_variables
},
'_meta': {'hostvars': {}}
}
'all': {
'hosts': [],
'vars': self.group_variables
},
'_meta': {'hostvars': {}}
}

# add all droplets by id and name
for droplet in self.data['droplets']:
Expand All @@ -379,22 +379,22 @@ def build_inventory(self):

# groups that are always present
for group in [
'region_' + droplet['region']['slug'],
'image_' + str(droplet['image']['id']),
'size_' + droplet['size']['slug'],
'distro_' + self.to_safe(droplet['image']['distribution']),
'status_' + droplet['status'],
'region_' + droplet['region']['slug'],
'image_' + str(droplet['image']['id']),
'size_' + droplet['size']['slug'],
'distro_' + self.to_safe(droplet['image']['distribution']),
'status_' + droplet['status'],

]:
]:
if group not in self.inventory:
self.inventory[group] = { 'hosts': [ ], 'vars': {} }
self.inventory[group]['hosts'].append(dest)

# groups that are not always present
for group in [
droplet['image']['slug'],
droplet['image']['name']
]:
droplet['image']['slug'],
droplet['image']['name']
]:
if group:
image = 'image_' + self.to_safe(group)
if image not in self.inventory:
Expand Down
4 changes: 2 additions & 2 deletions contrib/inventory/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def get_hosts(self, config):
# use hosts from config file
for host in hosts_list:
docker_host = host.get('host') or def_host or self._args.docker_host or \
self._env_args.docker_host or DEFAULT_DOCKER_HOST
self._env_args.docker_host or DEFAULT_DOCKER_HOST
api_version = host.get('version') or def_version or self._args.api_version or \
self._env_args.api_version or DEFAULT_DOCKER_API_VERSION
tls_hostname = host.get('tls_hostname') or def_tls_hostname or self._args.tls_hostname or \
Expand Down Expand Up @@ -816,7 +816,7 @@ def _parse_cli_args(self):
default_config = basename + '.yml'

parser = argparse.ArgumentParser(
description='Return Ansible inventory for one or more Docker hosts.')
description='Return Ansible inventory for one or more Docker hosts.')
parser.add_argument('--list', action='store_true', default=True,
help='List all containers (default: True)')
parser.add_argument('--debug', action='store_true', default=False,
Expand Down
2 changes: 1 addition & 1 deletion contrib/inventory/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def parse_cli_args(self):
''' Command line argument processing '''

parser = argparse.ArgumentParser(
description='Produce an Ansible Inventory file based on GCE')
description='Produce an Ansible Inventory file based on GCE')
parser.add_argument('--list', action='store_true', default=True,
help='List instances (default: True)')
parser.add_argument('--host', action='store',
Expand Down
2 changes: 1 addition & 1 deletion contrib/inventory/ssh_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def print_host(host):

def get_args(args_list):
parser = argparse.ArgumentParser(
description='ansible inventory script parsing .ssh/config')
description='ansible inventory script parsing .ssh/config')
mutex_group = parser.add_mutually_exclusive_group(required=True)
help_list = 'list all hosts from .ssh/config inventory'
mutex_group.add_argument('--list', action='store_true', help=help_list)
Expand Down
16 changes: 8 additions & 8 deletions docs/api/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Additional stuff for the LaTeX preamble.
#'preamble': '',

# Latex figure (float) alignment
#'figure_align': 'htbp',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
('index', 'ansible.tex', 'Ansible 2.2 Documentation', AUTHOR, 'manual'),
('index', 'ansible.tex', 'Ansible 2.2 Documentation', AUTHOR, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
2 changes: 1 addition & 1 deletion docs/docsite/rst/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
# (source start file, target name, title, author, document class
# [howto/manual]).
latex_documents = [
('index', 'ansible.tex', 'Ansible 1.2 Documentation',
('index', 'ansible.tex', 'Ansible 1.2 Documentation',
AUTHOR, 'manual'),
]

Expand Down
24 changes: 12 additions & 12 deletions docs/docsite/rst/dev_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,21 +238,21 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down
22 changes: 11 additions & 11 deletions examples/scripts/uptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ def main():

# create play with tasks
play_source = dict(
name = "Ansible Play",
hosts = host_list,
gather_facts = 'no',
tasks = [ dict(action=dict(module='command', args=dict(cmd='/usr/bin/uptime'))) ]
)
name = "Ansible Play",
hosts = host_list,
gather_facts = 'no',
tasks = [ dict(action=dict(module='command', args=dict(cmd='/usr/bin/uptime'))) ]
)
play = Play().load(play_source, variable_manager=variable_manager, loader=loader)

# actually run it
tqm = None
callback = ResultsCollector()
try:
tqm = TaskQueueManager(
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
options=options,
passwords=passwords,
)
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
options=options,
passwords=passwords,
)
tqm._stdout_callback = callback
result = tqm.run(play)
finally:
Expand Down
34 changes: 17 additions & 17 deletions hacking/tests/gen_distribution_version_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
import sys

filelist = [
'/etc/oracle-release',
'/etc/slackware-version',
'/etc/redhat-release',
'/etc/vmware-release',
'/etc/openwrt_release',
'/etc/system-release',
'/etc/alpine-release',
'/etc/release',
'/etc/arch-release',
'/etc/os-release',
'/etc/SuSE-release',
'/etc/gentoo-release',
'/etc/os-release',
'/etc/lsb-release',
'/etc/altlinux-release',
'/etc/os-release',
'/etc/coreos/update.conf',
'/etc/oracle-release',
'/etc/slackware-version',
'/etc/redhat-release',
'/etc/vmware-release',
'/etc/openwrt_release',
'/etc/system-release',
'/etc/alpine-release',
'/etc/release',
'/etc/arch-release',
'/etc/os-release',
'/etc/SuSE-release',
'/etc/gentoo-release',
'/etc/os-release',
'/etc/lsb-release',
'/etc/altlinux-release',
'/etc/os-release',
'/etc/coreos/update.conf',
]

fcont = {}
Expand Down
18 changes: 9 additions & 9 deletions lib/ansible/cli/adhoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ def run(self):
self._tqm = None
try:
self._tqm = TaskQueueManager(
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
options=self.options,
passwords=passwords,
stdout_callback=cb,
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
run_tree=run_tree,
)
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
options=self.options,
passwords=passwords,
stdout_callback=cb,
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
run_tree=run_tree,
)

result = self._tqm.run(play)
finally:
Expand Down
18 changes: 9 additions & 9 deletions lib/ansible/cli/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ def default(self, arg, forceshell=False):
self._tqm = None
try:
self._tqm = TaskQueueManager(
inventory=self.inventory,
variable_manager=self.variable_manager,
loader=self.loader,
options=self.options,
passwords=self.passwords,
stdout_callback=cb,
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
run_tree=False,
)
inventory=self.inventory,
variable_manager=self.variable_manager,
loader=self.loader,
options=self.options,
passwords=self.passwords,
stdout_callback=cb,
run_additional_callbacks=C.DEFAULT_LOAD_CALLBACK_PLUGINS,
run_tree=False,
)

result = self._tqm.run(play)
finally:
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/compat/six/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
not hasattr(_system_six, 'byte2int') or
not hasattr(_system_six, 'add_metaclass') or
not hasattr(_system_six.moves, 'urllib')
):
):

_system_six = False

Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/executor/play_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self, inventory, play, play_context, variable_manager, all_vars, st
setup_task.name = 'Gathering Facts'
setup_task.tags = ['always']
setup_task.args = {
'gather_subset': gather_subset,
'gather_subset': gather_subset,
}
if gather_timeout:
setup_task.args['gather_timeout'] = gather_timeout
Expand Down
Loading

0 comments on commit 10d9318

Please sign in to comment.