summaryrefslogtreecommitdiff
path: root/lib/ansible/modules
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2017-01-28 01:39:40 -0800
committerGitHub <noreply@github.com>2017-01-28 01:39:40 -0800
commite2c0b375d3c74ea14b82caf6771d0b94135bd4aa (patch)
tree38db84bedcea5a90ce964dd751709b6908b269d5 /lib/ansible/modules
parentd0d1158c5ef7c1f822e622bebd80eb9471285b0b (diff)
downloadansible-e2c0b375d3c74ea14b82caf6771d0b94135bd4aa.tar.gz
PEP 8 cleanup. (#20790)
* PEP 8 E115 cleanup. * PEP 8 E131 cleanup.
Diffstat (limited to 'lib/ansible/modules')
-rw-r--r--lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py2
-rw-r--r--lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py8
-rw-r--r--lib/ansible/modules/cloud/amazon/ecs_task.py4
-rw-r--r--lib/ansible/modules/cloud/amazon/redshift_subnet_group.py10
-rwxr-xr-xlib/ansible/modules/cloud/amazon/s3.py2
-rw-r--r--lib/ansible/modules/cloud/google/gce_net.py4
-rw-r--r--lib/ansible/modules/cloud/google/gce_tag.py6
-rw-r--r--lib/ansible/modules/database/misc/mongodb_user.py30
-rw-r--r--lib/ansible/modules/files/unarchive.py2
-rw-r--r--lib/ansible/modules/monitoring/statusio_maintenance.py3
-rw-r--r--lib/ansible/modules/network/cloudflare_dns.py4
-rw-r--r--lib/ansible/modules/network/nxos/nxos_feature.py5
-rw-r--r--lib/ansible/modules/network/snmp_facts.py2
-rw-r--r--lib/ansible/modules/system/lvol.py2
-rw-r--r--lib/ansible/modules/system/openwrt_init.py4
-rw-r--r--lib/ansible/modules/system/systemd.py4
-rw-r--r--lib/ansible/modules/web_infrastructure/taiga_issue.py4
17 files changed, 47 insertions, 49 deletions
diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py
index 4dcbf43f78..17543e9178 100644
--- a/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py
+++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py
@@ -297,7 +297,7 @@ def main():
# First check if we were given a dhcp_options_id
if not params['dhcp_options_id']:
- # No, so create new_options from the parameters
+ # No, so create new_options from the parameters
if params['dns_servers'] is not None:
new_options['domain-name-servers'] = params['dns_servers']
if params['netbios_name_servers'] is not None:
diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
index 38dffd8c25..f79377c1fa 100644
--- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
+++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
@@ -387,8 +387,8 @@ def find_vgw(client, module, vpn_gateway_id=None):
def ensure_vgw_present(client, module):
-# If an existing vgw name and type matches our args, then a match is considered to have been
-# found and we will not create another vgw.
+ # If an existing vgw name and type matches our args, then a match is considered to have been
+ # found and we will not create another vgw.
changed = False
params = dict()
@@ -472,8 +472,8 @@ def ensure_vgw_present(client, module):
def ensure_vgw_absent(client, module):
-# If an existing vgw name and type matches our args, then a match is considered to have been
-# found and we will take steps to delete it.
+ # If an existing vgw name and type matches our args, then a match is considered to have been
+ # found and we will take steps to delete it.
changed = False
params = dict()
diff --git a/lib/ansible/modules/cloud/amazon/ecs_task.py b/lib/ansible/modules/cloud/amazon/ecs_task.py
index a8ecc4dde4..88314ffc15 100644
--- a/lib/ansible/modules/cloud/amazon/ecs_task.py
+++ b/lib/ansible/modules/cloud/amazon/ecs_task.py
@@ -314,8 +314,8 @@ def main():
results['task']=existing
else:
if not module.check_mode:
- # it exists, so we should delete it and mark changed.
- # return info about the cluster deleted
+ # it exists, so we should delete it and mark changed.
+ # return info about the cluster deleted
results['task'] = service_mgr.stop_task(
module.params['cluster'],
module.params['task']
diff --git a/lib/ansible/modules/cloud/amazon/redshift_subnet_group.py b/lib/ansible/modules/cloud/amazon/redshift_subnet_group.py
index cecf68209a..f5aa01f24d 100644
--- a/lib/ansible/modules/cloud/amazon/redshift_subnet_group.py
+++ b/lib/ansible/modules/cloud/amazon/redshift_subnet_group.py
@@ -145,7 +145,7 @@ def main():
exists = len(matching_groups) > 0
except boto.exception.JSONResponseError as e:
if e.body['Error']['Code'] != 'ClusterSubnetGroupNotFoundFault':
- #if e.code != 'ClusterSubnetGroupNotFoundFault':
+ # if e.code != 'ClusterSubnetGroupNotFoundFault':
module.fail_json(msg=str(e))
if state == 'absent':
@@ -158,17 +158,17 @@ def main():
new_group = conn.create_cluster_subnet_group(group_name, group_description, group_subnets)
group = {
'name': new_group['CreateClusterSubnetGroupResponse']['CreateClusterSubnetGroupResult']
- ['ClusterSubnetGroup']['ClusterSubnetGroupName'],
+ ['ClusterSubnetGroup']['ClusterSubnetGroupName'],
'vpc_id': new_group['CreateClusterSubnetGroupResponse']['CreateClusterSubnetGroupResult']
- ['ClusterSubnetGroup']['VpcId'],
+ ['ClusterSubnetGroup']['VpcId'],
}
else:
changed_group = conn.modify_cluster_subnet_group(group_name, group_subnets, description=group_description)
group = {
'name': changed_group['ModifyClusterSubnetGroupResponse']['ModifyClusterSubnetGroupResult']
- ['ClusterSubnetGroup']['ClusterSubnetGroupName'],
+ ['ClusterSubnetGroup']['ClusterSubnetGroupName'],
'vpc_id': changed_group['ModifyClusterSubnetGroupResponse']['ModifyClusterSubnetGroupResult']
- ['ClusterSubnetGroup']['VpcId'],
+ ['ClusterSubnetGroup']['VpcId'],
}
changed = True
diff --git a/lib/ansible/modules/cloud/amazon/s3.py b/lib/ansible/modules/cloud/amazon/s3.py
index 5fc29563a9..5544b99074 100755
--- a/lib/ansible/modules/cloud/amazon/s3.py
+++ b/lib/ansible/modules/cloud/amazon/s3.py
@@ -601,7 +601,7 @@ def main():
if mode == 'put':
# Use this snippet to debug through conditionals:
-# module.exit_json(msg="Bucket return %s"%bucketrtn)
+ # module.exit_json(msg="Bucket return %s"%bucketrtn)
# Lets check the src path.
pathrtn = path_check(src)
diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py
index 1dc1c33fb2..f0f293d41f 100644
--- a/lib/ansible/modules/cloud/google/gce_net.py
+++ b/lib/ansible/modules/cloud/google/gce_net.py
@@ -450,12 +450,12 @@ def main():
except Exception as e:
module.fail_json(msg=unexpected_error_msg(e), changed=False)
if network:
-# json_output['d4'] = 'deleting %s' % name
+ # json_output['d4'] = 'deleting %s' % name
try:
gce.ex_destroy_network(network)
except Exception as e:
module.fail_json(msg=unexpected_error_msg(e), changed=False)
-# json_output['d5'] = 'deleted %s' % name
+ # json_output['d5'] = 'deleted %s' % name
changed = True
json_output['changed'] = changed
diff --git a/lib/ansible/modules/cloud/google/gce_tag.py b/lib/ansible/modules/cloud/google/gce_tag.py
index 03afa025d0..68e767562c 100644
--- a/lib/ansible/modules/cloud/google/gce_tag.py
+++ b/lib/ansible/modules/cloud/google/gce_tag.py
@@ -181,12 +181,12 @@ def main():
pem_file=dict(type='path'),
project_id=dict(),
),
- mutually_exclusive=[
+ mutually_exclusive=[
[ 'instance_name', 'instance_pattern' ]
- ],
+ ],
required_one_of=[
[ 'instance_name', 'instance_pattern' ]
- ]
+ ]
)
instance_name = module.params.get('instance_name')
diff --git a/lib/ansible/modules/database/misc/mongodb_user.py b/lib/ansible/modules/database/misc/mongodb_user.py
index 6674455ae0..a438761e23 100644
--- a/lib/ansible/modules/database/misc/mongodb_user.py
+++ b/lib/ansible/modules/database/misc/mongodb_user.py
@@ -296,21 +296,21 @@ def load_mongocnf():
def check_if_roles_changed(uinfo, roles, db_name):
-# We must be aware of users which can read the oplog on a replicaset
-# Such users must have access to the local DB, but since this DB does not store users credentials
-# and is not synchronized among replica sets, the user must be stored on the admin db
-# Therefore their structure is the following :
-# {
-# "_id" : "admin.oplog_reader",
-# "user" : "oplog_reader",
-# "db" : "admin", # <-- admin DB
-# "roles" : [
-# {
-# "role" : "read",
-# "db" : "local" # <-- local DB
-# }
-# ]
-# }
+ # We must be aware of users which can read the oplog on a replicaset
+ # Such users must have access to the local DB, but since this DB does not store users credentials
+ # and is not synchronized among replica sets, the user must be stored on the admin db
+ # Therefore their structure is the following :
+ # {
+ # "_id" : "admin.oplog_reader",
+ # "user" : "oplog_reader",
+ # "db" : "admin", # <-- admin DB
+ # "roles" : [
+ # {
+ # "role" : "read",
+ # "db" : "local" # <-- local DB
+ # }
+ # ]
+ # }
def make_sure_roles_are_a_list_of_dict(roles, db_name):
output = list()
diff --git a/lib/ansible/modules/files/unarchive.py b/lib/ansible/modules/files/unarchive.py
index 745557054d..57aa1fab0c 100644
--- a/lib/ansible/modules/files/unarchive.py
+++ b/lib/ansible/modules/files/unarchive.py
@@ -635,7 +635,7 @@ class TgzArchive(object):
for filename in out.splitlines():
# Compensate for locale-related problems in gtar output (octal unicode representation) #11348
-# filename = filename.decode('string_escape')
+ # filename = filename.decode('string_escape')
filename = codecs.escape_decode(filename)[0]
if filename and filename not in self.excludes:
self._files_in_archive.append(to_native(filename))
diff --git a/lib/ansible/modules/monitoring/statusio_maintenance.py b/lib/ansible/modules/monitoring/statusio_maintenance.py
index 2e1252a568..557e3dee89 100644
--- a/lib/ansible/modules/monitoring/statusio_maintenance.py
+++ b/lib/ansible/modules/monitoring/statusio_maintenance.py
@@ -299,8 +299,7 @@ def create_maintenance(auth_headers, url, statuspage, host_ids,
"statuspage_id": statuspage,
"components": component_id,
"containers": container_id,
- "all_infrastructure_affected":
- str(int(all_infrastructure_affected)),
+ "all_infrastructure_affected": str(int(all_infrastructure_affected)),
"automation": str(int(automation)),
"maintenance_name": title,
"maintenance_details": desc,
diff --git a/lib/ansible/modules/network/cloudflare_dns.py b/lib/ansible/modules/network/cloudflare_dns.py
index 81dda8bba7..14b142c1a1 100644
--- a/lib/ansible/modules/network/cloudflare_dns.py
+++ b/lib/ansible/modules/network/cloudflare_dns.py
@@ -638,8 +638,8 @@ def main():
('type','NS',['value']),
('type','SPF',['value'])
]
- ),
- required_one_of = (
+ ),
+ required_one_of = (
[['record','value','type']]
)
)
diff --git a/lib/ansible/modules/network/nxos/nxos_feature.py b/lib/ansible/modules/network/nxos/nxos_feature.py
index 2a532dd599..d69eb49986 100644
--- a/lib/ansible/modules/network/nxos/nxos_feature.py
+++ b/lib/ansible/modules/network/nxos/nxos_feature.py
@@ -419,8 +419,7 @@ def validate_feature(module, mode='show'):
'ethernet-link-oam': 'elo',
'port-security': 'eth_port_sec'
},
- 'config':
- {
+ 'config': {
'nve': 'nv overlay',
'vnseg_vlan': 'vn-segment-vlan-based',
'hsrp_engine': 'hsrp',
@@ -435,7 +434,7 @@ def validate_feature(module, mode='show'):
'elo': 'ethernet-link-oam',
'eth_port_sec': 'port-security'
}
- }
+ }
if feature in feature_to_be_mapped[mode]:
feature = feature_to_be_mapped[mode][feature]
diff --git a/lib/ansible/modules/network/snmp_facts.py b/lib/ansible/modules/network/snmp_facts.py
index 3e4cfc6c30..9fab434f2a 100644
--- a/lib/ansible/modules/network/snmp_facts.py
+++ b/lib/ansible/modules/network/snmp_facts.py
@@ -193,7 +193,7 @@ def main():
authkey=dict(required=False),
privkey=dict(required=False),
removeplaceholder=dict(required=False)),
- required_together = ( ['username','level','integrity','authkey'],['privacy','privkey'],),
+ required_together = ( ['username','level','integrity','authkey'],['privacy','privkey'],),
supports_check_mode=False)
m_args = module.params
diff --git a/lib/ansible/modules/system/lvol.py b/lib/ansible/modules/system/lvol.py
index b7fe179289..8718dfa9f0 100644
--- a/lib/ansible/modules/system/lvol.py
+++ b/lib/ansible/modules/system/lvol.py
@@ -313,7 +313,7 @@ def main():
size_unit = ''
if not '%' in size:
- # LVCREATE(8) -L --size option unit
+ # LVCREATE(8) -L --size option unit
if size[-1].lower() in 'bskmgtpe':
size_unit = size[-1].lower()
size = size[0:-1]
diff --git a/lib/ansible/modules/system/openwrt_init.py b/lib/ansible/modules/system/openwrt_init.py
index 7b4f7f79d3..e986775672 100644
--- a/lib/ansible/modules/system/openwrt_init.py
+++ b/lib/ansible/modules/system/openwrt_init.py
@@ -115,8 +115,8 @@ def main():
enabled = dict(type='bool'),
pattern = dict(required=False, default=None),
),
- supports_check_mode=True,
- required_one_of=[['state', 'enabled']],
+ supports_check_mode=True,
+ required_one_of=[['state', 'enabled']],
)
# initialize
diff --git a/lib/ansible/modules/system/systemd.py b/lib/ansible/modules/system/systemd.py
index caa578dc7f..2f93820a1a 100644
--- a/lib/ansible/modules/system/systemd.py
+++ b/lib/ansible/modules/system/systemd.py
@@ -267,8 +267,8 @@ def main():
user = dict(type='bool', default=False),
no_block = dict(type='bool', default=False),
),
- supports_check_mode=True,
- required_one_of=[['state', 'enabled', 'masked', 'daemon_reload']],
+ supports_check_mode=True,
+ required_one_of=[['state', 'enabled', 'masked', 'daemon_reload']],
)
systemctl = module.get_bin_path('systemctl')
diff --git a/lib/ansible/modules/web_infrastructure/taiga_issue.py b/lib/ansible/modules/web_infrastructure/taiga_issue.py
index 03be095286..d64f3fa9bc 100644
--- a/lib/ansible/modules/web_infrastructure/taiga_issue.py
+++ b/lib/ansible/modules/web_infrastructure/taiga_issue.py
@@ -208,7 +208,7 @@ def manage_issue(module, taiga_host, project_name, issue_subject, issue_priority
matching_issue_list_len = len(matching_issue_list)
if matching_issue_list_len == 0:
- # The issue does not exist in the project
+ # The issue does not exist in the project
if state == "present":
# This implies a change
changed = True
@@ -226,7 +226,7 @@ def manage_issue(module, taiga_host, project_name, issue_subject, issue_priority
return (True, changed, "Issue does not exist", {})
elif matching_issue_list_len == 1:
- # The issue exists in the project
+ # The issue exists in the project
if state == "absent":
# This implies a change
changed = True