diff --git a/contrib/inventory/abiquo.py b/contrib/inventory/abiquo.py index 0b5533bb6bb..f643503b178 100755 --- a/contrib/inventory/abiquo.py +++ b/contrib/inventory/abiquo.py @@ -18,7 +18,7 @@ This script generates an Ansible hosts file with these host groups: ABQ_xxx: Defines a hosts itself by Abiquo VM name label all: Contains all hosts defined in Abiquo user's enterprise -virtualdatecenter: Creates a host group for each virtualdatacenter containing all hosts defined on it +virtualdatecenter: Creates a host group for each virtualdatacenter containing all hosts defined on it virtualappliance: Creates a host group for each virtualappliance containing all hosts defined on it imagetemplate: Creates a host group for each image template containing all hosts using it @@ -110,7 +110,7 @@ def cache_available(config): return False -def generate_inv_from_api(enterprise_entity,config): +def generate_inv_from_api(enterprise_entity,config): try: inventory['all'] = {} inventory['all']['children'] = [] @@ -165,7 +165,7 @@ def generate_inv_from_api(enterprise_entity,config): meta_entity = next(link for link in (vmcollection['links']) if (link['rel']=='metadata')) try: metadata = api_get(meta_entity,config) - if (config.getfloat("api","version") >= 3.0): + if (config.getfloat("api","version") >= 3.0): vm_metadata = metadata['metadata'] else: vm_metadata = metadata['metadata']['metadata'] diff --git a/contrib/inventory/apache-libcloud.py b/contrib/inventory/apache-libcloud.py index fd020caae8a..f85148fae11 100755 --- a/contrib/inventory/apache-libcloud.py +++ b/contrib/inventory/apache-libcloud.py @@ -133,7 +133,7 @@ class LibcloudInventory(object): if config.has_option('driver', 'path'): self.path = config.get('driver', 'path') if config.has_option('driver', 'api_version'): - self.api_version = config.get('driver', 'api_version') + self.api_version = config.get('driver', 'api_version') Driver = get_driver(getattr(Provider, self.provider)) @@ -163,8 +163,8 @@ class LibcloudInventory(object): def do_api_calls_update_cache(self): - ''' - Do API calls to a location, and save data in cache files + ''' + Do API calls to a location, and save data in cache files ''' self.get_nodes() @@ -193,7 +193,7 @@ class LibcloudInventory(object): def add_node(self, node): ''' Adds a node to the inventory and index, as long as it is - addressable + addressable ''' # Only want running instances diff --git a/contrib/inventory/azure_rm.py b/contrib/inventory/azure_rm.py index cf9d7a98329..0232ce74fa0 100755 --- a/contrib/inventory/azure_rm.py +++ b/contrib/inventory/azure_rm.py @@ -32,7 +32,7 @@ The order of precedence is command line arguments, environment variables, and finally the [default] profile found in ~/.azure/credentials. If using a credentials file, it should be an ini formatted file with one or -more sections, which we refer to as profiles. The script looks for a +more sections, which we refer to as profiles. The script looks for a [default] section, if a profile is not specified either on the command line or with an environment variable. The keys in a profile will match the list of command line arguments below. @@ -42,7 +42,7 @@ in your ~/.azure/credentials file, or a service principal or Active Directory user. Command line arguments: - - profile + - profile - client_id - secret - subscription_id @@ -61,7 +61,7 @@ Environment variables: Run for Specific Host ----------------------- -When run for a specific host using the --host option, a resource group is +When run for a specific host using the --host option, a resource group is required. For a specific host, this script returns the following variables: { diff --git a/contrib/inventory/freeipa.py b/contrib/inventory/freeipa.py index 64ede999a43..a72b774cfaf 100755 --- a/contrib/inventory/freeipa.py +++ b/contrib/inventory/freeipa.py @@ -7,7 +7,7 @@ import json def initialize(): ''' This function initializes the FreeIPA/IPA API. This function requires - no arguments. A kerberos key must be present in the users keyring in + no arguments. A kerberos key must be present in the users keyring in order for this to work. ''' @@ -68,8 +68,8 @@ def parse_args(): def print_host(host): ''' - This function is really a stub, it could return variables to be used in - a playbook. However, at this point there are no variables stored in + This function is really a stub, it could return variables to be used in + a playbook. However, at this point there are no variables stored in FreeIPA/IPA. This function expects one string, this hostname to lookup variables for. diff --git a/contrib/inventory/softlayer.py b/contrib/inventory/softlayer.py index 796fd5ef408..43a1faa8c77 100755 --- a/contrib/inventory/softlayer.py +++ b/contrib/inventory/softlayer.py @@ -3,7 +3,7 @@ SoftLayer external inventory script. The SoftLayer Python API client is required. Use `pip install softlayer` to install it. -You have a few different options for configuring your username and api_key. You can pass +You have a few different options for configuring your username and api_key. You can pass environment variables (SL_USERNAME and SL_API_KEY). You can also write INI file to ~/.softlayer or /etc/softlayer.conf. For more information see the SL API at: - https://softlayer-python.readthedocs.org/en/latest/config_file.html diff --git a/contrib/inventory/spacewalk.py b/contrib/inventory/spacewalk.py index 3d0005e5bbe..a32ab8ea8d3 100755 --- a/contrib/inventory/spacewalk.py +++ b/contrib/inventory/spacewalk.py @@ -18,10 +18,10 @@ output of "spacewalk-report system-groups-systems|inventory". Tested with Ansible 1.9.2 and spacewalk 2.3 """ -# +# # Author:: Jon Miller # Copyright:: Copyright (c) 2013, Jon Miller -# +# # Extended for support of multiple organizations and # adding the "_meta" dictionary to --list output by # Bernhard Lichtinger 2015 @@ -30,15 +30,15 @@ Tested with Ansible 1.9.2 and spacewalk 2.3 # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or (at # your option) any later version. -# +# # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# +# from __future__ import print_function @@ -109,7 +109,7 @@ parser.add_option('--host', default=None, dest="host", parser.add_option('-H', '--human', dest="human", default=False, action="store_true", help="Produce a friendlier version of either server list or host detail") -parser.add_option('-o', '--org', default=None, dest="org_number", +parser.add_option('-o', '--org', default=None, dest="org_number", help="Limit to spacewalk organization number") parser.add_option('-p', default=False, dest="prefix_org_name", action="store_true", help="Prefix the group name with the organization number") diff --git a/docs/docsite/conf.py b/docs/docsite/conf.py index 2ee38085b8a..9167ca35b29 100644 --- a/docs/docsite/conf.py +++ b/docs/docsite/conf.py @@ -102,7 +102,7 @@ pygments_style = 'sphinx' highlight_language = 'YAML+Jinja' -#Substitutions, variables, entities, & shortcuts for text which do not need to link to anything. +#Substitutions, variables, entities, & shortcuts for text which do not need to link to anything. #For titles which should be a link, use the intersphinx anchors set at the index, chapter, and section levels, such as qi_start_: rst_epilog = """ .. |acapi| replace:: *Ansible Core API Guide* diff --git a/docs/docsite/rst/conf.py b/docs/docsite/rst/conf.py index ee49cdebba1..0c30e41ae11 100644 --- a/docs/docsite/rst/conf.py +++ b/docs/docsite/rst/conf.py @@ -102,7 +102,7 @@ pygments_style = 'sphinx' highlight_language = 'YAML+Jinja' -#Substitutions, variables, entities, & shortcuts for text which do not need to link to anything. +#Substitutions, variables, entities, & shortcuts for text which do not need to link to anything. #For titles which should be a link, use the intersphinx anchors set at the index, chapter, and section levels, such as qi_start_: rst_epilog = """ .. |acapi| replace:: *Ansible Core API Guide* diff --git a/lib/ansible/galaxy/login.py b/lib/ansible/galaxy/login.py index 29b6c094de3..d6bb0a6957a 100644 --- a/lib/ansible/galaxy/login.py +++ b/lib/ansible/galaxy/login.py @@ -54,12 +54,12 @@ class GalaxyLogin(object): self.get_credentials() def get_credentials(self): - display.display(u'\n\n' + "We need your " + stringc("Github login",'bright cyan') + + display.display(u'\n\n' + "We need your " + stringc("Github login",'bright cyan') + " to identify you.", screen_only=True) - display.display("This information will " + stringc("not be sent to Galaxy",'bright cyan') + + display.display("This information will " + stringc("not be sent to Galaxy",'bright cyan') + ", only to " + stringc("api.github.com.","yellow"), screen_only=True) display.display("The password will not be displayed." + u'\n\n', screen_only=True) - display.display("Use " + stringc("--github-token",'yellow') + + display.display("Use " + stringc("--github-token",'yellow') + " if you do not want to enter your password." + u'\n\n', screen_only=True) try: @@ -90,7 +90,7 @@ class GalaxyLogin(object): for token in tokens: if token['note'] == 'ansible-galaxy login': display.vvvvv('removing token: %s' % token['token_last_eight']) - try: + try: open_url('https://api.github.com/authorizations/%d' % token['id'], url_username=self.github_username, url_password=self.github_password, method='DELETE', force_basic_auth=True,) except HTTPError as e: diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index 9883abdc8ed..539951e2ceb 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -244,7 +244,7 @@ class GalaxyRole(object): elif role_data.get('github_branch', None): self.version = role_data['github_branch'] else: - self.version = 'master' + self.version = 'master' elif self.version != 'master': if role_versions and str(self.version) not in [a.get('name', None) for a in role_versions]: raise AnsibleError("- the specified version (%s) of %s was not found in the list of available versions (%s)." % (self.version, self.name, role_versions)) diff --git a/lib/ansible/galaxy/token.py b/lib/ansible/galaxy/token.py index 742c7b39f06..06836ee358b 100644 --- a/lib/ansible/galaxy/token.py +++ b/lib/ansible/galaxy/token.py @@ -51,10 +51,10 @@ class GalaxyToken(object): f = open(self.file,'w') f.close() os.chmod(self.file,S_IRUSR|S_IWUSR) # owner has +rw - display.vvv('Created %s' % self.file) + display.vvv('Created %s' % self.file) return open(self.file, 'r') - def set(self, token): + def set(self, token): self.config['token'] = token self.save() diff --git a/lib/ansible/inventory/yaml.py b/lib/ansible/inventory/yaml.py index 2dafccb3173..590f2a96527 100644 --- a/lib/ansible/inventory/yaml.py +++ b/lib/ansible/inventory/yaml.py @@ -78,7 +78,7 @@ class InventoryParser(object): self.groups[group] = Group(name=group) if isinstance(group_data, dict): - #make sure they are dicts + #make sure they are dicts for section in ['vars', 'children', 'hosts']: if section in group_data and isinstance(group_data[section], string_types): group_data[section] = { group_data[section]: None} diff --git a/lib/ansible/module_utils/azure_rm_common.py b/lib/ansible/module_utils/azure_rm_common.py index d646da93b03..69bb26127a0 100644 --- a/lib/ansible/module_utils/azure_rm_common.py +++ b/lib/ansible/module_utils/azure_rm_common.py @@ -375,10 +375,10 @@ class AzureRMModuleBase(object): ''' dependencies = dict() if enum_modules: - for module_name in enum_modules: + for module_name in enum_modules: mod = importlib.import_module(module_name) for mod_class_name, mod_class_obj in inspect.getmembers(mod, predicate=inspect.isclass): - dependencies[mod_class_name] = mod_class_obj + dependencies[mod_class_name] = mod_class_obj self.log("dependencies: "); self.log(str(dependencies)) serializer = Serializer(classes=dependencies) diff --git a/lib/ansible/module_utils/gcp.py b/lib/ansible/module_utils/gcp.py index 227ed74aee2..87415b392eb 100644 --- a/lib/ansible/module_utils/gcp.py +++ b/lib/ansible/module_utils/gcp.py @@ -209,7 +209,7 @@ def _get_gcp_credentials(module, require_valid_json=True, check_libcloud=False): 'project_id': project_id} def _validate_credentials_file(module, credentials_file, require_valid_json=True, check_libcloud=False): - """ + """ Check for valid credentials file. Optionally check for JSON format and if libcloud supports JSON. @@ -276,7 +276,7 @@ def gcp_connect(module, provider, get_driver, user_agent_product, user_agent_ver def get_google_cloud_credentials(module, scopes=[]): - """ + """ Get credentials object for use with Google Cloud client. To connect via libcloud, don't use this function, use gcp_connect instead. For @@ -297,7 +297,7 @@ def get_google_cloud_credentials(module, scopes=[]): :param scopes: list of scopes :type module: ``list`` of URIs - :returns: A tuple containing (google authorized) credentials object and + :returns: A tuple containing (google authorized) credentials object and params dict {'service_account_email': '...', 'credentials_file': '...', 'project_id': ...} :rtype: ``tuple`` """ @@ -326,7 +326,7 @@ def get_google_api_auth(module, scopes=[], user_agent_product='ansible-python-ap """ Authentication for use with google-python-api-client. - Function calls get_google_cloud_credentials, which attempts to assemble the credentials + Function calls get_google_cloud_credentials, which attempts to assemble the credentials from various locations. Next it attempts to authenticate with Google. This function returns an httplib2 (compatible) object that can be provided to the Google Python API client. diff --git a/lib/ansible/modules/cloud/amazon/ec2_ami_find.py b/lib/ansible/modules/cloud/amazon/ec2_ami_find.py index f7a529c7071..cd333050d18 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_ami_find.py +++ b/lib/ansible/modules/cloud/amazon/ec2_ami_find.py @@ -87,7 +87,7 @@ options: description: - Optional attribute which with to sort the results. - If specifying 'tag', the 'tag_name' parameter is required. - - Starting at version 2.1, additional sort choices of architecture, block_device_mapping, creationDate, hypervisor, is_public, location, owner_id, platform, root_device_name, root_device_type, state, and virtualization_type are supported. + - Starting at version 2.1, additional sort choices of architecture, block_device_mapping, creationDate, hypervisor, is_public, location, owner_id, platform, root_device_name, root_device_type, state, and virtualization_type are supported. choices: ['name', 'description', 'tag', 'architecture', 'block_device_mapping', 'creationDate', 'hypervisor', 'is_public', 'location', 'owner_id', 'platform', 'root_device_name', 'root_device_type', 'state', 'virtualization_type'] default: null required: false diff --git a/lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py b/lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py index 631a07a9a5b..dee82aef8f1 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py +++ b/lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py @@ -43,7 +43,7 @@ options: name: description: - Name of the customer gateway. - required: true + required: true state: description: - Create or terminate the Customer Gateway. @@ -108,7 +108,7 @@ gateway.customer_gateways: type: description: encryption type. returned: when gateway exists and is available. - sample: ipsec.1 + sample: ipsec.1 type: string ''' @@ -178,13 +178,13 @@ class Ec2CustomerGatewayManager: DryRun=False, Filters=[ { - 'Name': 'state', + 'Name': 'state', 'Values': [ 'available', ] }, { - 'Name': 'ip-address', + 'Name': 'ip-address', 'Values': [ ip_address, ] diff --git a/lib/ansible/modules/cloud/amazon/ec2_elb.py b/lib/ansible/modules/cloud/amazon/ec2_elb.py index cd2cf5fbae6..27ed37b3a5d 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_elb.py +++ b/lib/ansible/modules/cloud/amazon/ec2_elb.py @@ -129,7 +129,7 @@ class ElbManager: to report it out-of-service""" for lb in self.lbs: - initial_state = self._get_instance_health(lb) + initial_state = self._get_instance_health(lb) if initial_state is None: # Instance isn't registered with this load # balancer. Ignore it and try the next one. diff --git a/lib/ansible/modules/cloud/amazon/ec2_key.py b/lib/ansible/modules/cloud/amazon/ec2_key.py index 69d96fed977..90a68ec6370 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_key.py +++ b/lib/ansible/modules/cloud/amazon/ec2_key.py @@ -163,7 +163,7 @@ def main(): if key: # existing key found if key_material: - # EC2's fingerprints are non-trivial to generate, so push this key + # EC2's fingerprints are non-trivial to generate, so push this key # to a temporary name and make ec2 calculate the fingerprint for us. # # http://blog.jbrowne.com/?p=23 @@ -186,7 +186,7 @@ def main(): if key.fingerprint != tmpfingerprint: if not module.check_mode: key.delete() - key = ec2.import_key_pair(name, key_material) + key = ec2.import_key_pair(name, key_material) if wait: start = time.time() @@ -211,7 +211,7 @@ def main(): key = ec2.import_key_pair(name, key_material) else: ''' - No material provided, let AWS handle the key creation and + No material provided, let AWS handle the key creation and retrieve the private key ''' key = ec2.create_key_pair(name) diff --git a/lib/ansible/modules/cloud/amazon/ec2_lc.py b/lib/ansible/modules/cloud/amazon/ec2_lc.py index 7a8754b8994..34d289929cc 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_lc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_lc.py @@ -113,7 +113,7 @@ options: extends_documentation_fragment: - aws - ec2 -requires: +requires: - "boto >= 2.39.0" """ diff --git a/lib/ansible/modules/cloud/amazon/ec2_tag.py b/lib/ansible/modules/cloud/amazon/ec2_tag.py index 13653d31118..9f701a55d44 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_tag.py +++ b/lib/ansible/modules/cloud/amazon/ec2_tag.py @@ -20,7 +20,7 @@ ANSIBLE_METADATA = {'status': ['stableinterface'], DOCUMENTATION = ''' --- -module: ec2_tag +module: ec2_tag short_description: create and remove tag(s) to ec2 resources. description: - Creates, removes and lists tags from any EC2 resource. The resource is referenced by its resource id (e.g. an instance being i-XXXXXXX). It is designed to be used with complex args (tags), see the examples. This module has a dependency on python-boto. @@ -28,9 +28,9 @@ version_added: "1.3" options: resource: description: - - The EC2 resource id. + - The EC2 resource id. required: true - default: null + default: null aliases: [] state: description: @@ -97,10 +97,10 @@ EXAMPLES = ''' region: eu-west-1 resource: '{{ item.id }}' state: present - tags: + tags: Name: dbserver Env: production - with_subelements: + with_subelements: - ec2_vol.results - volumes @@ -164,7 +164,7 @@ def main(): if set(tags.items()).issubset(set(tagdict.items())): module.exit_json(msg="Tags already exists in %s." %resource, changed=False) else: - for (key, value) in set(tags.items()): + for (key, value) in set(tags.items()): if (key, value) not in set(tagdict.items()): dictadd[key] = value tagger = ec2.create_tags(resource, dictadd) 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 15baf151429..ed2901d3e8b 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py @@ -101,7 +101,7 @@ options: description: - The resource_id of an existing DHCP options set. If this is specified, then it will override other settings, except tags - (which will be updated to match) + (which will be updated to match) required: False default: None version_added: "2.1" diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py index 4e32cb1e8fa..95c9af9f553 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py @@ -357,11 +357,11 @@ def remove_network_acl(client, module): changed = True result[nacl_id] = "Successfully deleted" return changed, result - if not assoc_ids: + if not assoc_ids: delete_network_acl(nacl_id, client, module) changed = True result[nacl_id] = "Successfully deleted" - return changed, result + return changed, result return changed, result @@ -510,7 +510,7 @@ def subnets_to_associate(nacl, client, module): {'Name': 'tag:Name', 'Values': params}]) except botocore.exceptions.ClientError as e: module.fail_json(msg=str(e)) - return [s['SubnetId'] for s in subnets['Subnets'] if s['SubnetId']] + return [s['SubnetId'] for s in subnets['Subnets'] if s['SubnetId']] def main(): diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py index 4a744f3a23b..38ef37b008e 100755 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py @@ -44,7 +44,7 @@ options: tags: description: - Dictionary of tags to look for and apply when creating a Peering Connection. - required: false + required: false state: description: - Create, delete, accept, reject a peering connection. @@ -67,7 +67,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: Accept local VPC peering request @@ -87,7 +87,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: delete a local VPC peering Connection @@ -108,7 +108,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: Accept peering connection from remote account @@ -129,7 +129,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: Reject a local VPC peering Connection @@ -149,7 +149,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: Accept a cross account VPC peering connection request @@ -174,7 +174,7 @@ EXAMPLES = ''' tags: Name: Peering connection for VPC 21 to VPC 22 CostCode: CC1234 - Project: phoenix + Project: phoenix register: vpc_peer - name: Reject a cross account VPC peering Connection @@ -269,7 +269,7 @@ def create_peer_connection(client, module): changed = True return (changed, peering_conn['VpcPeeringConnection']['VpcPeeringConnectionId']) except botocore.exceptions.ClientError as e: - module.fail_json(msg=str(e)) + module.fail_json(msg=str(e)) def peer_status(client, module): diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py index b52e5129843..870b50cc72a 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py @@ -432,7 +432,7 @@ def ensure_vgw_present(client, module): else: # attach the vgw to the supplied vpc attached_vgw = attach_vgw(client, module, vpn_gateway_id) - vgw = find_vgw(client, module, [vpn_gateway_id]) + vgw = find_vgw(client, module, [vpn_gateway_id]) changed = True # if params['VpcId'] is not provided, check the vgw is attached to a vpc. if so, detach it. @@ -443,7 +443,7 @@ def ensure_vgw_present(client, module): if existing_vgw[0]['VpcAttachments'][0]['State'] == 'attached': # detach the vpc from the vgw vpc_to_detach = existing_vgw[0]['VpcAttachments'][0]['VpcId'] - detach_vgw(client, module, vpn_gateway_id, vpc_to_detach) + detach_vgw(client, module, vpn_gateway_id, vpc_to_detach) changed = True vgw = find_vgw(client, module, [vpn_gateway_id]) @@ -492,16 +492,16 @@ def ensure_vgw_absent(client, module): if existing_vgw[0]['VpcAttachments'] != [] and existing_vgw[0]['VpcAttachments'][0]['State'] == 'attached': if params['VpcId']: if params['VpcId'] != existing_vgw[0]['VpcAttachments'][0]['VpcId']: - module.fail_json(msg='The vpc-id provided does not match the vpc-id currently attached - please check the AWS console') + module.fail_json(msg='The vpc-id provided does not match the vpc-id currently attached - please check the AWS console') else: - # detach the vpc from the vgw + # detach the vpc from the vgw detach_vgw(client, module, params['VpnGatewayIds'], params['VpcId']) deleted_vgw = delete_vgw(client, module, params['VpnGatewayIds']) changed = True else: - # attempt to detach any attached vpcs + # attempt to detach any attached vpcs vpc_to_detach = existing_vgw[0]['VpcAttachments'][0]['VpcId'] detach_vgw(client, module, params['VpnGatewayIds'], vpc_to_detach) deleted_vgw = delete_vgw(client, module, params['VpnGatewayIds']) @@ -519,7 +519,7 @@ def ensure_vgw_absent(client, module): else: #Check that a name and type argument has been supplied if no vgw-id if not module.params.get('name') or not module.params.get('type'): - module.fail_json(msg='A name and type is required when no vgw-id and a status of \'absent\' is suppled') + module.fail_json(msg='A name and type is required when no vgw-id and a status of \'absent\' is suppled') existing_vgw = find_vgw(client, module) if existing_vgw != [] and existing_vgw[0]['State'] != 'deleted': @@ -527,10 +527,10 @@ def ensure_vgw_absent(client, module): if existing_vgw[0]['VpcAttachments'] != [] and existing_vgw[0]['VpcAttachments'][0]['State'] == 'attached': if params['VpcId']: if params['VpcId'] != existing_vgw[0]['VpcAttachments'][0]['VpcId']: - module.fail_json(msg='The vpc-id provided does not match the vpc-id currently attached - please check the AWS console') + module.fail_json(msg='The vpc-id provided does not match the vpc-id currently attached - please check the AWS console') else: - # detach the vpc from the vgw + # detach the vpc from the vgw detach_vgw(client, module, vpn_gateway_id, params['VpcId']) #now that the vpc has been detached, delete the vgw @@ -538,7 +538,7 @@ def ensure_vgw_absent(client, module): changed = True else: - # attempt to detach any attached vpcs + # attempt to detach any attached vpcs vpc_to_detach = existing_vgw[0]['VpcAttachments'][0]['VpcId'] detach_vgw(client, module, vpn_gateway_id, vpc_to_detach) changed = True @@ -562,7 +562,7 @@ def ensure_vgw_absent(client, module): def main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( - state=dict(default='present', choices=['present', 'absent']), + state=dict(default='present', choices=['present', 'absent']), region=dict(required=True), name=dict(), vpn_gateway_id=dict(), diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py index d6e92e112de..aa79a0844f0 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py @@ -36,7 +36,7 @@ options: default: None vpn_gateway_ids: description: - - Get details of a specific Virtual Gateway ID. This value should be provided as a list. + - Get details of a specific Virtual Gateway ID. This value should be provided as a list. required: false default: None author: "Nick Aslanidis (@naslanidis)" @@ -66,7 +66,7 @@ EXAMPLES = ''' ec2_vpc_vgw_facts: region: ap-southeast-2 profile: production - vpn_gateway_ids: vgw-c432f6a7 + vpn_gateway_ids: vgw-c432f6a7 register: vgw_facts ''' @@ -83,7 +83,7 @@ virtual_gateways: "key": "Name", "value": "TEST-VGW" } - ], + ], "type": "ipsec.1", "vpc_attachments": [ { diff --git a/lib/ansible/modules/cloud/amazon/ec2_win_password.py b/lib/ansible/modules/cloud/amazon/ec2_win_password.py index 4d246d43676..c29b86cb85e 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_win_password.py +++ b/lib/ansible/modules/cloud/amazon/ec2_win_password.py @@ -28,7 +28,7 @@ author: "Rick Mendes (@rickmendes)" options: instance_id: description: - - The instance id to get the password data from. + - The instance id to get the password data from. required: true key_file: description: @@ -37,7 +37,7 @@ options: key_passphrase: version_added: "2.0" description: - - The passphrase for the instance key pair. The key must use DES or 3DES encryption for this module to decrypt it. You can use openssl to convert your password protected keys if they do not use DES or 3DES. ex) openssl rsa -in current_key -out new_key -des3. + - The passphrase for the instance key pair. The key must use DES or 3DES encryption for this module to decrypt it. You can use openssl to convert your password protected keys if they do not use DES or 3DES. ex) openssl rsa -in current_key -out new_key -des3. required: false default: null wait: diff --git a/lib/ansible/modules/cloud/amazon/rds.py b/lib/ansible/modules/cloud/amazon/rds.py index 04f6516b825..d4ff306951e 100644 --- a/lib/ansible/modules/cloud/amazon/rds.py +++ b/lib/ansible/modules/cloud/amazon/rds.py @@ -166,7 +166,7 @@ options: default: null aws_secret_key: description: - - AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used. + - AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used. required: false aliases: [ 'ec2_secret_key', 'secret_key' ] aws_access_key: @@ -296,7 +296,7 @@ EXAMPLES = ''' wait: yes wait_timeout: 600 tags: - Name: pg1_test_name_tag + Name: pg1_test_name_tag register: rds - local_action: diff --git a/lib/ansible/modules/cloud/amazon/s3_website.py b/lib/ansible/modules/cloud/amazon/s3_website.py index d81dcdf0a48..a47eee51fde 100644 --- a/lib/ansible/modules/cloud/amazon/s3_website.py +++ b/lib/ansible/modules/cloud/amazon/s3_website.py @@ -30,7 +30,7 @@ options: description: - "Name of the s3 bucket" required: true - default: null + default: null error_key: description: - "The object key name to use when a 4XX class error occurs. To remove an error key, set to None." diff --git a/lib/ansible/modules/cloud/amazon/sns_topic.py b/lib/ansible/modules/cloud/amazon/sns_topic.py index 6d85994f97a..7c3ac484cf2 100644 --- a/lib/ansible/modules/cloud/amazon/sns_topic.py +++ b/lib/ansible/modules/cloud/amazon/sns_topic.py @@ -81,16 +81,16 @@ EXAMPLES = """ name: "alarms" state: present display_name: "alarm SNS topic" - delivery_policy: + delivery_policy: http: - defaultHealthyRetryPolicy: + defaultHealthyRetryPolicy: minDelayTarget: 2 maxDelayTarget: 4 numRetries: 3 numMaxDelayRetries: 5 backoffFunction: "" disableSubscriptionOverrides: True - defaultThrottlePolicy: + defaultThrottlePolicy: maxReceivesPerSecond: 10 subscriptions: - endpoint: "my_email_address@example.com" diff --git a/lib/ansible/modules/cloud/amazon/sqs_queue.py b/lib/ansible/modules/cloud/amazon/sqs_queue.py index 984a761ced7..9b99f35c899 100644 --- a/lib/ansible/modules/cloud/amazon/sqs_queue.py +++ b/lib/ansible/modules/cloud/amazon/sqs_queue.py @@ -86,19 +86,19 @@ extends_documentation_fragment: """ RETURN = ''' -default_visibility_timeout: +default_visibility_timeout: description: The default visibility timeout in seconds. returned: always sample: 30 -delivery_delay: +delivery_delay: description: The delivery delay in seconds. returned: always sample: 0 -maximum_message_size: +maximum_message_size: description: The maximum message size in bytes. returned: always sample: 262144 -message_retention_period: +message_retention_period: description: The message retention period in seconds. returned: always sample: 345600 @@ -110,7 +110,7 @@ queue_arn: description: The queue's Amazon resource name (ARN). returned: on successful creation or update of the queue sample: 'arn:aws:sqs:us-east-1:199999999999:queuename-987d2de0' -receive_message_wait_time: +receive_message_wait_time: description: The receive message wait time in seconds. returned: always sample: 0 @@ -179,7 +179,7 @@ def create_or_update_sqs_queue(connection, module): try: queue = connection.get_queue(queue_name) if queue: - # Update existing + # Update existing result['changed'] = update_sqs_queue(queue, check_mode=module.check_mode, **queue_attributes) else: # Create new diff --git a/lib/ansible/modules/cloud/azure/azure_rm_deployment.py b/lib/ansible/modules/cloud/azure/azure_rm_deployment.py index 88ecf0cea02..fae1d942981 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_deployment.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_deployment.py @@ -43,7 +43,7 @@ options: default: westus deployment_mode: description: - - In incremental mode, resources are deployed without deleting existing resources that are not included in the template. + - In incremental mode, resources are deployed without deleting existing resources that are not included in the template. In complete mode resources are deployed and existing resources in the resource group not included in the template are deleted. required: false default: incremental diff --git a/lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py b/lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py index e159953ba3e..1af5b5e2f86 100644 --- a/lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py +++ b/lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py @@ -114,7 +114,7 @@ EXAMPLES = ''' port: 443 nodes: - ipAddress: 10.11.22.123 - privatePort: 80 + privatePort: 80 state: present - name: Add node to an existing loadbalancer pool @@ -130,7 +130,7 @@ EXAMPLES = ''' port: 443 nodes: - ipAddress: 10.11.22.234 - privatePort: 80 + privatePort: 80 state: nodes_present - name: Remove node from an existing loadbalancer pool @@ -146,7 +146,7 @@ EXAMPLES = ''' port: 443 nodes: - ipAddress: 10.11.22.234 - privatePort: 80 + privatePort: 80 state: nodes_absent - name: Delete LoadbalancerPool @@ -162,7 +162,7 @@ EXAMPLES = ''' port: 443 nodes: - ipAddress: 10.11.22.123 - privatePort: 80 + privatePort: 80 state: port_absent - name: Delete Loadbalancer @@ -178,7 +178,7 @@ EXAMPLES = ''' port: 443 nodes: - ipAddress: 10.11.22.123 - privatePort: 80 + privatePort: 80 state: absent ''' diff --git a/lib/ansible/modules/cloud/docker/docker_container.py b/lib/ansible/modules/cloud/docker/docker_container.py index 54c99a290f4..8a3d35d0321 100644 --- a/lib/ansible/modules/cloud/docker/docker_container.py +++ b/lib/ansible/modules/cloud/docker/docker_container.py @@ -138,7 +138,7 @@ options: - exposed force_kill: description: - - Use the kill command when stopping a running container. + - Use the kill command when stopping a running container. default: false required: false groups: @@ -159,7 +159,7 @@ options: recreated. Stop this behavior by setting C(ignore_image) to I(True). default: false required: false - version_added: "2.2" + version_added: "2.2" image: description: - Repository path and tag used to create the container. If an image is not found or pull is true, the image @@ -313,10 +313,10 @@ options: any other mappings. - If C(networks) parameter is provided, will inspect each network to see if there exists a bridge network with optional parameter com.docker.network.bridge.host_binding_ipv4. - If such a network is found, then published ports where no host IP address is specified + If such a network is found, then published ports where no host IP address is specified will be bound to the host IP pointed to by com.docker.network.bridge.host_binding_ipv4. - Note that the first bridge network with a com.docker.network.bridge.host_binding_ipv4 - value encountered in the list of C(networks) is the one that will be used. + Note that the first bridge network with a com.docker.network.bridge.host_binding_ipv4 + value encountered in the list of C(networks) is the one that will be used. aliases: - ports required: false @@ -394,7 +394,7 @@ options: re-create a matching container, even if it is running. Use restart to force a matching container to be stopped and restarted. Use force_kill to kill a container rather than stopping it. Use keep_volumes to retain volumes associated with a removed container.' - - 'I(stopped) - Asserts that the container is first I(present), and then if the container is running moves it to a stopped + - 'I(stopped) - Asserts that the container is first I(present), and then if the container is running moves it to a stopped state. Use force_kill to kill a container rather than stopping it.' required: false default: started @@ -518,7 +518,7 @@ EXAMPLES = ''' name: mycontainer state: present image: ubuntu:14.04 - command: sleep infinity + command: sleep infinity - name: Stop a container docker_container: @@ -1210,7 +1210,7 @@ class Container(DockerBaseClass): # assuming if the container was running, it must have been detached. detach = not (config.get('AttachStderr') and config.get('AttachStdout')) - # "ExposedPorts": null returns None type & causes AttributeError - PR #5517 + # "ExposedPorts": null returns None type & causes AttributeError - PR #5517 if config.get('ExposedPorts') is not None: expected_exposed = [re.sub(r'/.+$', '', p) for p in config.get('ExposedPorts', dict()).keys()] else: @@ -1874,7 +1874,7 @@ class ContainerManager(DockerBaseClass): return self._get_container(container_id) def container_remove(self, container_id, link=False, force=False): - volume_state = (not self.parameters.keep_volumes) + volume_state = (not self.parameters.keep_volumes) self.log("remove container container:%s v:%s link:%s force%s" % (container_id, volume_state, link, force)) self.results['actions'].append(dict(removed=container_id, volume_state=volume_state, link=link, force=force)) self.results['changed'] = True diff --git a/lib/ansible/modules/cloud/docker/docker_service.py b/lib/ansible/modules/cloud/docker/docker_service.py index 537d60a3486..b27bfed1590 100644 --- a/lib/ansible/modules/cloud/docker/docker_service.py +++ b/lib/ansible/modules/cloud/docker/docker_service.py @@ -503,24 +503,24 @@ AUTH_PARAM_MAPPING = { @contextmanager def stdout_redirector(path_name): - old_stdout = sys.stdout + old_stdout = sys.stdout fd = open(path_name, 'w') sys.stdout = fd try: yield finally: - sys.stdout = old_stdout + sys.stdout = old_stdout def get_stdout(path_name): full_stdout = '' - last_line = '' + last_line = '' with open(path_name, 'r') as fd: for line in fd: # strip terminal format/color chars new_line = re.sub(r'\x1b\[.+m', '', line.encode('ascii')) full_stdout += new_line if new_line.strip(): - # Assuming last line contains the error message + # Assuming last line contains the error message last_line = new_line.strip().encode('utf-8') fd.close() os.remove(path_name) @@ -666,12 +666,12 @@ class ContainerManager(DockerBaseClass): if self.pull: pull_output = self.cmd_pull() - result['changed'] = pull_output['changed'] + result['changed'] = pull_output['changed'] result['actions'] += pull_output['actions'] if self.build: build_output = self.cmd_build() - result['changed'] = build_output['changed'] + result['changed'] = build_output['changed'] result['actions'] += build_output['actions'] for service in self.project.services: @@ -679,8 +679,8 @@ class ContainerManager(DockerBaseClass): plan = service.convergence_plan(strategy=converge) if plan.action != 'noop': result['changed'] = True - result_action = dict(service=service.name) - result_action[plan.action] = [] + result_action = dict(service=service.name) + result_action[plan.action] = [] for container in plan.containers: result_action[plan.action].append(dict( id=container.id, @@ -712,17 +712,17 @@ class ContainerManager(DockerBaseClass): if self.stopped: stop_output = self.cmd_stop(service_names) - result['changed'] = stop_output['changed'] + result['changed'] = stop_output['changed'] result['actions'] += stop_output['actions'] if self.restarted: restart_output = self.cmd_restart(service_names) - result['changed'] = restart_output['changed'] + result['changed'] = restart_output['changed'] result['actions'] += restart_output['actions'] if self.scale: scale_output = self.cmd_scale() - result['changed'] = scale_output['changed'] + result['changed'] = scale_output['changed'] result['actions'] += scale_output['actions'] for service in self.project.services: @@ -791,7 +791,7 @@ class ContainerManager(DockerBaseClass): if not self.check_mode: for service in self.project.get_services(self.services, include_deps=False): if 'image' not in service.options: - continue + continue self.log('Pulling image for service %s' % service.name) # store the existing image ID @@ -809,16 +809,16 @@ class ContainerManager(DockerBaseClass): try: service.pull(ignore_pull_failures=False) except Exception as exc: - self.client.fail("Error: pull failed with %s" % str(exc)) + self.client.fail("Error: pull failed with %s" % str(exc)) # store the new image ID - new_image_id = '' + new_image_id = '' try: image = service.image() if image and image.get('Id'): new_image_id = image['Id'] except NoSuchImageError as exc: - self.client.fail("Error: service image lookup failed after pull - %s" % str(exc)) + self.client.fail("Error: service image lookup failed after pull - %s" % str(exc)) if new_image_id != old_image_id: # if a new image was pulled @@ -856,13 +856,13 @@ class ContainerManager(DockerBaseClass): try: new_image_id = service.build(pull=True, no_cache=self.nocache) except Exception as exc: - self.client.fail("Error: build failed with %s" % str(exc)) + self.client.fail("Error: build failed with %s" % str(exc)) if new_image_id not in old_image_id: # if a new image was built result['changed'] = True result['actions'].append(dict( - service=service.name, + service=service.name, built_image=dict( name=service.image_name, id=new_image_id @@ -901,7 +901,7 @@ class ContainerManager(DockerBaseClass): service_res = dict( service=service.name, stop=[] - ) + ) for container in service.containers(stopped=False): result['changed'] = True service_res['stop'].append(dict( @@ -977,7 +977,7 @@ class ContainerManager(DockerBaseClass): service.scale(int(self.scale[service.name])) except Exception as exc: self.client.fail("Error scaling %s - %s" % (service.name, str(exc))) - result['actions'].append(service_res) + result['actions'].append(service_res) return result diff --git a/lib/ansible/modules/cloud/google/gc_storage.py b/lib/ansible/modules/cloud/google/gc_storage.py index 98f0d1480dc..32c2eb45536 100644 --- a/lib/ansible/modules/cloud/google/gc_storage.py +++ b/lib/ansible/modules/cloud/google/gc_storage.py @@ -155,12 +155,12 @@ def grant_check(module, gs, obj): grant = [ x for x in acp.entries.entry_list if x.scope.type == 'AllUsers'] if not grant: obj.set_acl('public-read') - module.exit_json(changed=True, result="The objects permission as been set to public-read") + module.exit_json(changed=True, result="The objects permission as been set to public-read") if module.params.get('permission') == 'authenticated-read': grant = [ x for x in acp.entries.entry_list if x.scope.type == 'AllAuthenticatedUsers'] if not grant: obj.set_acl('authenticated-read') - module.exit_json(changed=True, result="The objects permission as been set to authenticated-read") + module.exit_json(changed=True, result="The objects permission as been set to authenticated-read") except gs.provider.storage_response_error as e: module.fail_json(msg= str(e)) return True @@ -240,7 +240,7 @@ def create_dirkey(module, gs, bucket, obj): def path_check(path): if os.path.exists(path): - return True + return True else: return False @@ -262,7 +262,7 @@ def transform_headers(headers): def upload_gsfile(module, gs, bucket, obj, src, expiry): try: bucket = gs.lookup(bucket) - key = bucket.new_key(obj) + key = bucket.new_key(obj) key.set_contents_from_filename( filename=src, headers=transform_headers(module.params.get('headers')) @@ -326,7 +326,7 @@ def handle_put(module, gs, bucket, obj, overwrite, src, expiration): else: upload_gsfile(module, gs, bucket, obj, src, expiration) - if not bucket_rc: + if not bucket_rc: create_bucket(module, gs, bucket) upload_gsfile(module, gs, bucket, obj, src, expiration) @@ -352,7 +352,7 @@ def handle_delete(module, gs, bucket, obj): module.fail_json(msg="Bucket or Bucket & object parameter is required.", failed=True) def handle_create(module, gs, bucket, obj): - if bucket and not obj: + if bucket and not obj: if bucket_check(module, gs, bucket): module.exit_json(msg="Bucket already exists.", changed=False) else: @@ -366,7 +366,7 @@ def handle_create(module, gs, bucket, obj): if bucket_check(module, gs, bucket): if key_check(module, gs, bucket, dirobj): module.exit_json(msg="Bucket %s and key %s already exists."% (bucket, obj), changed=False) - else: + else: create_dirkey(module, gs, bucket, dirobj) else: create_bucket(module, gs, bucket) @@ -431,7 +431,7 @@ def main(): module.fail_json(msg="Local object for PUT does not exist", failed=True) handle_put(module, gs, bucket, obj, overwrite, src, expiry) - # Support for deleting an object if we have both params. + # Support for deleting an object if we have both params. if mode == 'delete': handle_delete(module, gs, bucket, obj) diff --git a/lib/ansible/modules/cloud/google/gcdns_record.py b/lib/ansible/modules/cloud/google/gcdns_record.py index 7c209c5cbad..22859d7d722 100644 --- a/lib/ansible/modules/cloud/google/gcdns_record.py +++ b/lib/ansible/modules/cloud/google/gcdns_record.py @@ -144,7 +144,7 @@ notes: - See also M(gcdns_zone). - This modules's underlying library does not support in-place updates for DNS resource records. Instead, resource records are quickly deleted and - recreated. + recreated. - SOA records are technically supported, but their functionality is limited to verifying that a zone's existing SOA record matches a pre-determined value. The SOA record cannot be updated. diff --git a/lib/ansible/modules/cloud/google/gce_lb.py b/lib/ansible/modules/cloud/google/gce_lb.py index dc31bb3b421..1bcdcc24a94 100644 --- a/lib/ansible/modules/cloud/google/gce_lb.py +++ b/lib/ansible/modules/cloud/google/gce_lb.py @@ -86,7 +86,7 @@ options: description: - the protocol used for the load-balancer packet forwarding, tcp or udp required: false - default: "tcp" + default: "tcp" choices: ['tcp', 'udp'] region: description: @@ -151,7 +151,7 @@ author: "Eric Johnson (@erjohnso) " EXAMPLES = ''' # Simple example of creating a new LB, adding members, and a health check -- local_action: +- local_action: module: gce_lb name: testlb region: us-central1 diff --git a/lib/ansible/modules/cloud/google/gce_mig.py b/lib/ansible/modules/cloud/google/gce_mig.py index 024055dff30..facc02bc7b3 100644 --- a/lib/ansible/modules/cloud/google/gce_mig.py +++ b/lib/ansible/modules/cloud/google/gce_mig.py @@ -293,7 +293,7 @@ except ImportError: def _check_params(params, field_list): - """ + """ Helper to validate params. Use this in function definitions if they require specific fields @@ -323,7 +323,7 @@ def _check_params(params, field_list): def _validate_autoscaling_params(params): - """ + """ Validate that the minimum configuration is present for autoscaling. :param params: Ansible dictionary containing autoscaling configuration @@ -331,7 +331,7 @@ def _validate_autoscaling_params(params): key 'autoscaling'. :type params: ``dict`` - :return: Tuple containing a boolean and a string. True if autoscaler + :return: Tuple containing a boolean and a string. True if autoscaler is valid, False otherwise, plus str for message. :rtype: ``(``bool``, ``str``)`` """ @@ -372,7 +372,7 @@ def _validate_autoscaling_params(params): def _validate_named_port_params(params): - """ + """ Validate the named ports parameters :param params: Ansible dictionary containing named_ports configuration @@ -404,7 +404,7 @@ def _validate_named_port_params(params): def _get_instance_list(mig, field='name', filter_list=['NONE']): - """ + """ Helper to grab field from instances response. :param mig: Managed Instance Group Object from libcloud. @@ -427,10 +427,10 @@ def _get_instance_list(mig, field='name', filter_list=['NONE']): def _gen_gce_as_policy(as_params): - """ + """ Take Autoscaler params and generate GCE-compatible policy. - :param as_params: Dictionary in Ansible-playbook format + :param as_params: Dictionary in Ansible-playbook format containing policy arguments. :type as_params: ``dict`` diff --git a/lib/ansible/modules/cloud/google/gcpubsub.py b/lib/ansible/modules/cloud/google/gcpubsub.py index d0c7b4c39ad..989d6903900 100644 --- a/lib/ansible/modules/cloud/google/gcpubsub.py +++ b/lib/ansible/modules/cloud/google/gcpubsub.py @@ -41,7 +41,7 @@ options: description: - Dictionary containing a subscripton name associated with a topic (required), along with optional ack_deadline, push_endpoint and pull. For pulling from a subscription, message_ack (bool), max_messages (int) and return_immediate are available as subfields. See subfields name, push_endpoint and ack_deadline for more information. required: False - name: + name: description: Subfield of subscription. Required if subscription is specified. See examples. required: False ack_deadline: @@ -156,13 +156,13 @@ state: type: str sample: "present" -subscription: +subscription: description: Name of subscription. returned: When subscription fields are specified type: str sample: "mysubscription" -topic: +topic: description: Name of topic. returned: Always type: str diff --git a/lib/ansible/modules/cloud/google/gcpubsub_facts.py b/lib/ansible/modules/cloud/google/gcpubsub_facts.py index 8484b0b3516..7c943d85ea9 100644 --- a/lib/ansible/modules/cloud/google/gcpubsub_facts.py +++ b/lib/ansible/modules/cloud/google/gcpubsub_facts.py @@ -45,7 +45,7 @@ options: state: description: - list is the only valid option. - required: False + required: False ''' EXAMPLES = ''' @@ -72,7 +72,7 @@ subscriptions: returned: When view is set to subscriptions. type: list sample: ["mysubscription", "mysubscription2"] -topic: +topic: description: Name of topic. Used to filter subscriptions. returned: Always type: str diff --git a/lib/ansible/modules/cloud/linode/linode.py b/lib/ansible/modules/cloud/linode/linode.py index 393ba0fe66d..d51eb3529d2 100644 --- a/lib/ansible/modules/cloud/linode/linode.py +++ b/lib/ansible/modules/cloud/linode/linode.py @@ -179,14 +179,14 @@ def randompass(): ''' Generate a long random password that comply to Linode requirements ''' - # Linode API currently requires the following: - # It must contain at least two of these four character classes: + # Linode API currently requires the following: + # It must contain at least two of these four character classes: # lower case letters - upper case letters - numbers - punctuation # we play it safe :) import random import string # as of python 2.4, this reseeds the PRNG from urandom - random.seed() + random.seed() lower = ''.join(random.choice(string.ascii_lowercase) for x in range(6)) upper = ''.join(random.choice(string.ascii_uppercase) for x in range(6)) number = ''.join(random.choice(string.digits) for x in range(6)) @@ -218,11 +218,11 @@ def getInstanceDetails(api, server): 'ip_id': ip['IPADDRESSID']}) return instance -def linodeServers(module, api, state, name, plan, distribution, datacenter, linode_id, +def linodeServers(module, api, state, name, plan, distribution, datacenter, linode_id, payment_term, password, ssh_pub_key, swap, wait, wait_timeout): instances = [] changed = False - new_server = False + new_server = False servers = [] disks = [] configs = [] @@ -233,7 +233,7 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino # For the moment we only consider linode_id as criteria for match # Later we can use more (size, name, etc.) and update existing servers = api.linode_list(LinodeId=linode_id) - # Attempt to fetch details about disks and configs only if servers are + # Attempt to fetch details about disks and configs only if servers are # found with linode_id if servers: disks = api.linode_disk_list(LinodeId=linode_id) @@ -256,7 +256,7 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino # Create linode entity new_server = True try: - res = api.linode_create(DatacenterID=datacenter, PlanID=plan, + res = api.linode_create(DatacenterID=datacenter, PlanID=plan, PaymentTerm=payment_term) linode_id = res['LinodeID'] # Update linode Label to match name @@ -282,17 +282,17 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino size = servers[0]['TOTALHD'] - swap if ssh_pub_key: res = api.linode_disk_createfromdistribution( - LinodeId=linode_id, DistributionID=distribution, + LinodeId=linode_id, DistributionID=distribution, rootPass=password, rootSSHKey=ssh_pub_key, Label='%s data disk (lid: %s)' % (name, linode_id), Size=size) else: res = api.linode_disk_createfromdistribution( - LinodeId=linode_id, DistributionID=distribution, rootPass=password, + LinodeId=linode_id, DistributionID=distribution, rootPass=password, Label='%s data disk (lid: %s)' % (name, linode_id), Size=size) jobs.append(res['JobID']) # Create SWAP disk - res = api.linode_disk_create(LinodeId=linode_id, Type='swap', - Label='%s swap disk (lid: %s)' % (name, linode_id), + res = api.linode_disk_create(LinodeId=linode_id, Type='swap', + Label='%s swap disk (lid: %s)' % (name, linode_id), Size=swap) jobs.append(res['JobID']) except Exception as e: @@ -364,12 +364,12 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino time.sleep(5) if wait and wait_timeout <= time.time(): # waiting took too long - module.fail_json(msg = 'Timeout waiting on %s (lid: %s)' % + module.fail_json(msg = 'Timeout waiting on %s (lid: %s)' % (server['LABEL'], server['LINODEID'])) # Get a fresh copy of the server details server = api.linode_list(LinodeId=server['LINODEID'])[0] if server['STATUS'] == -2: - module.fail_json(msg = '%s (lid: %s) failed to boot' % + module.fail_json(msg = '%s (lid: %s) failed to boot' % (server['LABEL'], server['LINODEID'])) # From now on we know the task is a success # Build instance report @@ -380,7 +380,7 @@ def linodeServers(module, api, state, name, plan, distribution, datacenter, lino else: instance['status'] = 'Starting' - # Return the root password if this is a new box and no SSH key + # Return the root password if this is a new box and no SSH key # has been provided if new_server and not ssh_pub_key: instance['password'] = password @@ -495,7 +495,7 @@ def main(): except Exception as e: module.fail_json(msg = '%s' % e.value[0]['ERRORMESSAGE']) - linodeServers(module, api, state, name, plan, distribution, datacenter, linode_id, + linodeServers(module, api, state, name, plan, distribution, datacenter, linode_id, payment_term, password, ssh_pub_key, swap, wait, wait_timeout) # import module snippets diff --git a/lib/ansible/modules/cloud/misc/ovirt.py b/lib/ansible/modules/cloud/misc/ovirt.py index 048bf34bc4c..6df53bed9c0 100644 --- a/lib/ansible/modules/cloud/misc/ovirt.py +++ b/lib/ansible/modules/cloud/misc/ovirt.py @@ -446,7 +446,7 @@ def main(): vmcpus = module.params['instance_cpus'] # number of cpu vmnic = module.params['instance_nic'] # network interface vmnetwork = module.params['instance_network'] # logical network - vmmem = module.params['instance_mem'] # mem size + vmmem = module.params['instance_mem'] # mem size vmdisk_alloc = module.params['disk_alloc'] # thin, preallocated vmdisk_int = module.params['disk_int'] # disk interface virtio or ide vmos = module.params['instance_os'] # Operating System diff --git a/lib/ansible/modules/cloud/misc/proxmox_kvm.py b/lib/ansible/modules/cloud/misc/proxmox_kvm.py index 9397d11ff1a..85b595317a9 100644 --- a/lib/ansible/modules/cloud/misc/proxmox_kvm.py +++ b/lib/ansible/modules/cloud/misc/proxmox_kvm.py @@ -600,7 +600,7 @@ EXAMPLES = ''' node : sabrewulf state : absent -# Get VM current state +# Get VM current state - proxmox_kvm: api_user : root@pam api_password: secret @@ -638,7 +638,7 @@ vmid: type: int sample: 115 status: - description: + description: - The current virtual machine status. - Returned only when C(state=current) returned: success @@ -646,7 +646,7 @@ status: sample: '{ "changed": false, "msg": "VM kropta with vmid = 110 is running", - "status": "running" + "status": "running" }' ''' diff --git a/lib/ansible/modules/cloud/misc/virt.py b/lib/ansible/modules/cloud/misc/virt.py index 3e9c098f3d3..1a907ca1749 100644 --- a/lib/ansible/modules/cloud/misc/virt.py +++ b/lib/ansible/modules/cloud/misc/virt.py @@ -96,12 +96,12 @@ tasks: RETURN = ''' # for list_vms command -list_vms: +list_vms: description: The list of vms defined on the remote system type: dictionary returned: success sample: [ - "build.example.org", + "build.example.org", "dev.example.org" ] # for status command diff --git a/lib/ansible/modules/cloud/misc/virt_net.py b/lib/ansible/modules/cloud/misc/virt_net.py index 8e7df65e897..999ff8cb454 100644 --- a/lib/ansible/modules/cloud/misc/virt_net.py +++ b/lib/ansible/modules/cloud/misc/virt_net.py @@ -260,7 +260,7 @@ class LibvirtConnection(object): else: # pretend there was a change res = 0 - if res == 0: + if res == 0: return True else: # change the host diff --git a/lib/ansible/modules/cloud/openstack/_glance_image.py b/lib/ansible/modules/cloud/openstack/_glance_image.py index 520814353f5..d915da8a566 100644 --- a/lib/ansible/modules/cloud/openstack/_glance_image.py +++ b/lib/ansible/modules/cloud/openstack/_glance_image.py @@ -157,7 +157,7 @@ def _get_ksclient(module, kwargs): auth_url=kwargs.get('auth_url')) except Exception as e: module.fail_json(msg="Error authenticating to the keystone: %s " % e.message) - return client + return client def _get_endpoint(module, client, endpoint_type): @@ -186,7 +186,7 @@ def _glance_image_present(module, params, client): try: for image in client.images.list(): if image.name == params['name']: - return image.id + return image.id return None except Exception as e: module.fail_json(msg="Error in fetching image list: %s" % e.message) diff --git a/lib/ansible/modules/cloud/openstack/_nova_compute.py b/lib/ansible/modules/cloud/openstack/_nova_compute.py index 8edd6116443..56252feea7f 100644 --- a/lib/ansible/modules/cloud/openstack/_nova_compute.py +++ b/lib/ansible/modules/cloud/openstack/_nova_compute.py @@ -337,7 +337,7 @@ def _add_floating_ip_from_pool(module, nova, server): if not pool_ips: try: new_ip = nova.floating_ips.create(pool) - except Exception as e: + except Exception as e: module.fail_json(msg = "Unable to create floating ip: %s" % (e.message)) pool_ips.append(new_ip.ip) # Add to the main list diff --git a/lib/ansible/modules/cloud/openstack/_nova_keypair.py b/lib/ansible/modules/cloud/openstack/_nova_keypair.py index 9c210573110..4c5265e3f0b 100644 --- a/lib/ansible/modules/cloud/openstack/_nova_keypair.py +++ b/lib/ansible/modules/cloud/openstack/_nova_keypair.py @@ -135,7 +135,7 @@ def main(): if module.params['public_key'] and (module.params['public_key'] != key.public_key ): module.fail_json(msg = "name {} present but key hash not the same as offered. Delete key first.".format(key['name'])) else: - module.exit_json(changed = False, result = "Key present") + module.exit_json(changed = False, result = "Key present") try: key = nova.keypairs.create(module.params['name'], module.params['public_key']) except Exception as e: diff --git a/lib/ansible/modules/cloud/openstack/os_client_config.py b/lib/ansible/modules/cloud/openstack/os_client_config.py index cc840085f67..aef425ccf3a 100644 --- a/lib/ansible/modules/cloud/openstack/os_client_config.py +++ b/lib/ansible/modules/cloud/openstack/os_client_config.py @@ -72,7 +72,7 @@ def main(): clouds.append(cloud.config) module.exit_json(ansible_facts=dict(openstack=dict(clouds=clouds))) except exceptions.OpenStackConfigException as e: - module.fail_json(msg=str(e)) + module.fail_json(msg=str(e)) # import module snippets from ansible.module_utils.basic import * diff --git a/lib/ansible/modules/cloud/openstack/os_project_facts.py b/lib/ansible/modules/cloud/openstack/os_project_facts.py index 856b6304ce7..f4e31682143 100644 --- a/lib/ansible/modules/cloud/openstack/os_project_facts.py +++ b/lib/ansible/modules/cloud/openstack/os_project_facts.py @@ -96,7 +96,7 @@ openstack_projects: returned: always, but can be null type: complex contains: - id: + id: description: Unique UUID. returned: success type: string diff --git a/lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py b/lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py index e3d2e99c4b0..ee4cd22c59b 100644 --- a/lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py +++ b/lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py @@ -26,8 +26,8 @@ description: version_added: "2.2" author: Pascal HERAUD @pascalheraud notes: - - Uses the python OVH Api U(https://github.com/ovh/python-ovh). - You have to create an application (a key and secret) with a consummer + - Uses the python OVH Api U(https://github.com/ovh/python-ovh). + You have to create an application (a key and secret) with a consummer key as described into U(https://eu.api.ovh.com/g934.first_step_with_api) requirements: - ovh > 0.3.5 @@ -79,13 +79,13 @@ options: type: "int" default: 120 description: - - The timeout in seconds used to wait for a task to be + - The timeout in seconds used to wait for a task to be completed. Default is 120 seconds. ''' EXAMPLES = ''' -# Adds or modify the backend '212.1.1.1' to a +# Adds or modify the backend '212.1.1.1' to a # loadbalancing 'ip-1.1.1.1' - ovh_ip_loadbalancing: name: ip-1.1.1.1 diff --git a/lib/ansible/modules/cloud/packet/packet_device.py b/lib/ansible/modules/cloud/packet/packet_device.py index e1f34b1ed3a..b3a072706b3 100644 --- a/lib/ansible/modules/cloud/packet/packet_device.py +++ b/lib/ansible/modules/cloud/packet/packet_device.py @@ -43,7 +43,7 @@ options: count_offset: description: - - From which number to start the count. + - From which number to start the count. device_ids: description: @@ -59,9 +59,9 @@ options: hostnames: description: - - A hostname of a device, or a list of hostnames. + - A hostname of a device, or a list of hostnames. - If given string or one-item list, you can use the C("%d") Python string format to expand numbers from count. - - If only one hostname, it might be expanded to list if count>1. + - If only one hostname, it might be expanded to list if count>1. aliases: [name] lock: @@ -127,7 +127,7 @@ EXAMPLES = ''' plan: baremetal_0 facility: sjc1 -- name: create 3 ubuntu devices called server-01, server-02 and server-03 +- name: create 3 ubuntu devices called server-01, server-02 and server-03 hosts: localhost tasks: - packet_device: @@ -435,7 +435,7 @@ def wait_for_ips(module, packet_conn, created_devices): % [d.hostname for d in created_devices]) -def get_existing_devices(module, packet_conn): +def get_existing_devices(module, packet_conn): project_id = module.params.get('project_id') return packet_conn.list_devices(project_id, params={'per_page': MAX_DEVICES}) @@ -545,7 +545,7 @@ def main(): if not module.params.get('auth_token'): _fail_msg = ( "if Packet API token is not in environment variable %s, " - "the auth_token parameter is required" % + "the auth_token parameter is required" % PACKET_API_TOKEN_ENV_VAR) module.fail_json(msg=_fail_msg) diff --git a/lib/ansible/modules/cloud/packet/packet_sshkey.py b/lib/ansible/modules/cloud/packet/packet_sshkey.py index 6f362e2bd28..b17ad7bf87a 100644 --- a/lib/ansible/modules/cloud/packet/packet_sshkey.py +++ b/lib/ansible/modules/cloud/packet/packet_sshkey.py @@ -92,9 +92,9 @@ sshkeys: type: array sample: [ { - "fingerprint": "5c:93:74:7c:ed:07:17:62:28:75:79:23:d6:08:93:46", - "id": "41d61bd8-3342-428b-a09c-e67bdd18a9b7", - "key": "ssh-dss AAAAB3NzaC1kc3MAAACBAIfNT5S0ncP4BBJBYNhNPxFF9lqVhfPeu6SM1LoCocxqDc1AT3zFRi8hjIf6TLZ2AA4FYbcAWxLMhiBxZRVldT9GdBXile78kAK5z3bKTwq152DCqpxwwbaTIggLFhsU8wrfBsPWnDuAxZ0h7mmrCjoLIE3CNLDA/NmV3iB8xMThAAAAFQCStcesSgR1adPORzBxTr7hug92LwAAAIBOProm3Gk+HWedLyE8IfofLaOeRnbBRHAOL4z0SexKkVOnQ/LGN/uDIIPGGBDYTvXgKZT+jbHeulRJ2jKgfSpGKN4JxFQ8uzVH492jEiiUJtT72Ss1dCV4PmyERVIw+f54itihV3z/t25dWgowhb0int8iC/OY3cGodlmYb3wdcQAAAIBuLbB45djZXzUkOTzzcRDIRfhaxo5WipbtEM2B1fuBt2gyrvksPpH/LK6xTjdIIb0CxPu4OCxwJG0aOz5kJoRnOWIXQGhH7VowrJhsqhIc8gN9ErbO5ea8b1L76MNcAotmBDeTUiPw01IJ8MdDxfmcsCslJKgoRKSmQpCwXQtN2g== tomk@hp2", + "fingerprint": "5c:93:74:7c:ed:07:17:62:28:75:79:23:d6:08:93:46", + "id": "41d61bd8-3342-428b-a09c-e67bdd18a9b7", + "key": "ssh-dss AAAAB3NzaC1kc3MAAACBAIfNT5S0ncP4BBJBYNhNPxFF9lqVhfPeu6SM1LoCocxqDc1AT3zFRi8hjIf6TLZ2AA4FYbcAWxLMhiBxZRVldT9GdBXile78kAK5z3bKTwq152DCqpxwwbaTIggLFhsU8wrfBsPWnDuAxZ0h7mmrCjoLIE3CNLDA/NmV3iB8xMThAAAAFQCStcesSgR1adPORzBxTr7hug92LwAAAIBOProm3Gk+HWedLyE8IfofLaOeRnbBRHAOL4z0SexKkVOnQ/LGN/uDIIPGGBDYTvXgKZT+jbHeulRJ2jKgfSpGKN4JxFQ8uzVH492jEiiUJtT72Ss1dCV4PmyERVIw+f54itihV3z/t25dWgowhb0int8iC/OY3cGodlmYb3wdcQAAAIBuLbB45djZXzUkOTzzcRDIRfhaxo5WipbtEM2B1fuBt2gyrvksPpH/LK6xTjdIIb0CxPu4OCxwJG0aOz5kJoRnOWIXQGhH7VowrJhsqhIc8gN9ErbO5ea8b1L76MNcAotmBDeTUiPw01IJ8MdDxfmcsCslJKgoRKSmQpCwXQtN2g== tomk@hp2", "label": "mynewkey33" } ] @@ -251,7 +251,7 @@ def main(): if not module.params.get('auth_token'): _fail_msg = ( "if Packet API token is not in environment variable %s, " - "the auth_token parameter is required" % + "the auth_token parameter is required" % PACKET_API_TOKEN_ENV_VAR) module.fail_json(msg=_fail_msg) diff --git a/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py b/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py index 5215f71c683..6ad2fea75d6 100644 --- a/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py +++ b/lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py @@ -76,7 +76,7 @@ EXAMPLES = ''' datacenter: Tardis One wait_timeout: 500 -# Destroy a Datacenter. This will remove all servers, volumes, and other objects in the datacenter. +# Destroy a Datacenter. This will remove all servers, volumes, and other objects in the datacenter. - profitbricks_datacenter: datacenter: Tardis One wait_timeout: 500 @@ -177,7 +177,7 @@ def remove_datacenter(module, profitbricks): """ Removes a Datacenter. - This will remove a datacenter. + This will remove a datacenter. module : AnsibleModule object profitbricks: authenticated profitbricks object. diff --git a/lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py b/lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py index 3dacb74998d..7848a02e15f 100644 --- a/lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py +++ b/lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py @@ -172,7 +172,7 @@ def detach_volume(module, profitbricks): """ Detaches a volume. - This will remove a volume from the server. + This will remove a volume from the server. module : AnsibleModule object profitbricks: authenticated profitbricks object. diff --git a/lib/ansible/modules/cloud/rackspace/rax_cbs.py b/lib/ansible/modules/cloud/rackspace/rax_cbs.py index a09ce53def1..3a10c0a90cf 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_cbs.py +++ b/lib/ansible/modules/cloud/rackspace/rax_cbs.py @@ -83,7 +83,7 @@ options: description: - how long before wait gives up, in seconds default: 300 -author: +author: - "Christopher H. Laco (@claco)" - "Matt Martz (@sivel)" extends_documentation_fragment: rackspace.openstack diff --git a/lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py b/lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py index c21f5231e48..2f676227321 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py +++ b/lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py @@ -62,7 +62,7 @@ options: description: - how long before wait gives up, in seconds default: 300 -author: +author: - "Christopher H. Laco (@claco)" - "Matt Martz (@sivel)" extends_documentation_fragment: rackspace.openstack diff --git a/lib/ansible/modules/cloud/rackspace/rax_clb.py b/lib/ansible/modules/cloud/rackspace/rax_clb.py index c0d62c5ebd0..cbdb02e108f 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_clb.py +++ b/lib/ansible/modules/cloud/rackspace/rax_clb.py @@ -107,7 +107,7 @@ options: description: - how long before wait gives up, in seconds default: 300 -author: +author: - "Christopher H. Laco (@claco)" - "Matt Martz (@sivel)" extends_documentation_fragment: rackspace diff --git a/lib/ansible/modules/cloud/rackspace/rax_identity.py b/lib/ansible/modules/cloud/rackspace/rax_identity.py index baa856447a3..a7a0012df3b 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_identity.py +++ b/lib/ansible/modules/cloud/rackspace/rax_identity.py @@ -34,7 +34,7 @@ options: choices: ['present', 'absent'] default: present required: false -author: +author: - "Christopher H. Laco (@claco)" - "Matt Martz (@sivel)" extends_documentation_fragment: rackspace.openstack diff --git a/lib/ansible/modules/cloud/rackspace/rax_network.py b/lib/ansible/modules/cloud/rackspace/rax_network.py index 7ff6edd0eca..29a372a9c81 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_network.py +++ b/lib/ansible/modules/cloud/rackspace/rax_network.py @@ -43,7 +43,7 @@ options: description: - cidr of the network being created default: null -author: +author: - "Christopher H. Laco (@claco)" - "Jesse Keating (@j2sol)" extends_documentation_fragment: rackspace.openstack diff --git a/lib/ansible/modules/cloud/rackspace/rax_queue.py b/lib/ansible/modules/cloud/rackspace/rax_queue.py index a1112460db8..8a218f34e28 100644 --- a/lib/ansible/modules/cloud/rackspace/rax_queue.py +++ b/lib/ansible/modules/cloud/rackspace/rax_queue.py @@ -39,7 +39,7 @@ options: - present - absent default: present -author: +author: - "Christopher H. Laco (@claco)" - "Matt Martz (@sivel)" extends_documentation_fragment: rackspace diff --git a/lib/ansible/modules/cloud/softlayer/sl_vm.py b/lib/ansible/modules/cloud/softlayer/sl_vm.py index 33cb8b22817..4696f471808 100644 --- a/lib/ansible/modules/cloud/softlayer/sl_vm.py +++ b/lib/ansible/modules/cloud/softlayer/sl_vm.py @@ -206,7 +206,7 @@ EXAMPLES = ''' - hostname: instance-3 domain: anydomain.com datacenter: dal09 - tags: + tags: - ansible-module-test - ansible-module-test-slaves hourly: True diff --git a/lib/ansible/modules/cloud/vmware/vsphere_copy.py b/lib/ansible/modules/cloud/vmware/vsphere_copy.py index 7e2ef125c86..5e084b46ed9 100644 --- a/lib/ansible/modules/cloud/vmware/vsphere_copy.py +++ b/lib/ansible/modules/cloud/vmware/vsphere_copy.py @@ -26,7 +26,7 @@ DOCUMENTATION = ''' --- module: vsphere_copy short_description: Copy a file to a vCenter datastore -description: +description: - Upload files to a vCenter datastore version_added: 2.0 author: Dag Wieers (@dagwieers) diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_app.py b/lib/ansible/modules/cloud/webfaction/webfaction_app.py index a9670955226..cf47bda5020 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_app.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_app.py @@ -101,7 +101,7 @@ EXAMPLES = ''' webfaction_app: name="my_wsgi_app1" state=present - type=mod_wsgi35-python27 + type=mod_wsgi35-python27 login_name={{webfaction_user}} login_password={{webfaction_passwd}} machine={{webfaction_machine}} @@ -168,8 +168,8 @@ def main(): # If this isn't a dry run, create the app result.update( webfaction.create_app( - session_id, app_name, app_type, - module.boolean(module.params['autostart']), + session_id, app_name, app_type, + module.boolean(module.params['autostart']), module.params['extra_info'], module.boolean(module.params['port_open']) ) diff --git a/lib/ansible/modules/cloud/webfaction/webfaction_site.py b/lib/ansible/modules/cloud/webfaction/webfaction_site.py index 9f415f5f3a1..7a28f40cdb0 100644 --- a/lib/ansible/modules/cloud/webfaction/webfaction_site.py +++ b/lib/ansible/modules/cloud/webfaction/webfaction_site.py @@ -95,8 +95,8 @@ EXAMPLES = ''' webfaction_site: name: testsite1 state: present - host: myhost.webfaction.com - subdomains: + host: myhost.webfaction.com + subdomains: - 'testsite1.my_domain.org' site_apps: - ['testapp1', '/'] @@ -167,8 +167,8 @@ def main(): changed = False ) - positional_args = [ - session_id, site_name, site_ip, + positional_args = [ + session_id, site_name, site_ip, module.boolean(module.params['https']), module.params['subdomains'], ] diff --git a/lib/ansible/modules/commands/command.py b/lib/ansible/modules/commands/command.py index 78fd16aa4dc..6c0c56edfdd 100644 --- a/lib/ansible/modules/commands/command.py +++ b/lib/ansible/modules/commands/command.py @@ -75,7 +75,7 @@ notes: The M(command) module is much more secure as it's not affected by the user's environment. - " C(creates), C(removes), and C(chdir) can be specified after the command. For instance, if you only want to run a command if a certain file does not exist, use this." -author: +author: - Ansible Core Team - Michael DeHaan ''' diff --git a/lib/ansible/modules/database/misc/kibana_plugin.py b/lib/ansible/modules/database/misc/kibana_plugin.py index 77c87b6c924..b747a99b7d5 100644 --- a/lib/ansible/modules/database/misc/kibana_plugin.py +++ b/lib/ansible/modules/database/misc/kibana_plugin.py @@ -49,7 +49,7 @@ options: url: description: - Set exact URL to download the plugin from. - For local file, prefix its absolute path with file:// + For local file, prefix its absolute path with file:// required: False default: None timeout: diff --git a/lib/ansible/modules/database/mssql/mssql_db.py b/lib/ansible/modules/database/mssql/mssql_db.py index cbd9bf03787..337429e8895 100644 --- a/lib/ansible/modules/database/mssql/mssql_db.py +++ b/lib/ansible/modules/database/mssql/mssql_db.py @@ -80,7 +80,7 @@ notes: requirements: - python >= 2.7 - pymssql -author: Vedit Firat Arig +author: Vedit Firat Arig ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/database/mysql/mysql_replication.py b/lib/ansible/modules/database/mysql/mysql_replication.py index 76bcdc16c47..837d2b5117b 100644 --- a/lib/ansible/modules/database/mysql/mysql_replication.py +++ b/lib/ansible/modules/database/mysql/mysql_replication.py @@ -34,7 +34,7 @@ short_description: Manage MySQL replication description: - Manages MySQL server replication, slave, master status get and change master host. version_added: "1.3" -author: "Balazs Pocze (@banyek)" +author: "Balazs Pocze (@banyek)" options: mode: description: diff --git a/lib/ansible/modules/database/postgresql/postgresql_ext.py b/lib/ansible/modules/database/postgresql/postgresql_ext.py index f9987868231..6ca9b3434ed 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_ext.py +++ b/lib/ansible/modules/database/postgresql/postgresql_ext.py @@ -143,7 +143,7 @@ def main(): state = module.params["state"] changed = False - # To use defaults values, keyword arguments must be absent, so + # To use defaults values, keyword arguments must be absent, so # check which values are empty and don't include in the **kw # dictionary params_map = { diff --git a/lib/ansible/modules/database/postgresql/postgresql_lang.py b/lib/ansible/modules/database/postgresql/postgresql_lang.py index 650212f1cde..4885798760b 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_lang.py +++ b/lib/ansible/modules/database/postgresql/postgresql_lang.py @@ -26,17 +26,17 @@ DOCUMENTATION = ''' module: postgresql_lang short_description: Adds, removes or changes procedural languages with a PostgreSQL database. description: - - Adds, removes or changes procedural languages with a PostgreSQL database. + - Adds, removes or changes procedural languages with a PostgreSQL database. - This module allows you to add a language, remote a language or change the trust - relationship with a PostgreSQL database. The module can be used on the machine + relationship with a PostgreSQL database. The module can be used on the machine where executed or on a remote host. - When removing a language from a database, it is possible that dependencies prevent - the database from being removed. In that case, you can specify casade to - automatically drop objects that depend on the language (such as functions in the - language). In case the language can't be deleted because it is required by the + the database from being removed. In that case, you can specify casade to + automatically drop objects that depend on the language (such as functions in the + language). In case the language can't be deleted because it is required by the database system, you can specify fail_on_drop=no to ignore the error. - Be carefull when marking a language as trusted since this could be a potential - security breach. Untrusted languages allow only users with the PostgreSQL superuser + security breach. Untrusted languages allow only users with the PostgreSQL superuser privilege to use this language to create new functions. version_added: "1.7" options: @@ -53,13 +53,13 @@ options: choices: [ "yes", "no" ] db: description: - - name of database where the language will be added, removed or changed + - name of database where the language will be added, removed or changed required: false default: null force_trust: description: - marks the language as trusted, even if it's marked as untrusted in pg_pltemplate. - - use with care! + - use with care! required: false default: no choices: [ "yes", "no" ] @@ -72,8 +72,8 @@ options: choices: [ "yes", "no" ] cascade: description: - - when dropping a language, also delete object that depend on this language. - - only used when C(state=absent). + - when dropping a language, also delete object that depend on this language. + - only used when C(state=absent). required: false default: no choices: [ "yes", "no" ] @@ -118,7 +118,7 @@ author: "Jens Depuydt (@jensdepuydt)" EXAMPLES = ''' # Add language pltclu to database testdb if it doesn't exist: -- postgresql_lang db=testdb lang=pltclu state=present +- postgresql_lang db=testdb lang=pltclu state=present # Add language pltclu to database testdb if it doesn't exist and mark it as trusted: # Marks the language as trusted if it exists but isn't trusted yet diff --git a/lib/ansible/modules/database/postgresql/postgresql_schema.py b/lib/ansible/modules/database/postgresql/postgresql_schema.py index 892690197cb..cf321e998aa 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_schema.py +++ b/lib/ansible/modules/database/postgresql/postgresql_schema.py @@ -87,7 +87,7 @@ EXAMPLES = ''' name: acme # Create a new schema "acme" with a user "bob" who will own it -- postgresql_schema: +- postgresql_schema: name: acme owner: bob diff --git a/lib/ansible/modules/database/vertica/vertica_schema.py b/lib/ansible/modules/database/vertica/vertica_schema.py index 0bc1918d318..08380729e79 100644 --- a/lib/ansible/modules/database/vertica/vertica_schema.py +++ b/lib/ansible/modules/database/vertica/vertica_schema.py @@ -26,7 +26,7 @@ module: vertica_schema version_added: '2.0' short_description: Adds or removes Vertica database schema and roles. description: - - Adds or removes Vertica database schema and, optionally, roles + - Adds or removes Vertica database schema and, optionally, roles with schema access privileges. - A schema will not be removed until all the objects have been dropped. - In such a situation, if the module tries to remove the schema it diff --git a/lib/ansible/modules/database/vertica/vertica_user.py b/lib/ansible/modules/database/vertica/vertica_user.py index 48d20c0f6d2..99819c7f6c4 100644 --- a/lib/ansible/modules/database/vertica/vertica_user.py +++ b/lib/ansible/modules/database/vertica/vertica_user.py @@ -253,7 +253,7 @@ def present(user_facts, cursor, user, profile, resource_pool, if ldap: if ldap != (user_facts[user_key]['expired'] == 'True'): query_fragments.append("password expire") - changed = True + changed = True elif expired is not None and expired != (user_facts[user_key]['expired'] == 'True'): if expired: query_fragments.append("password expire") diff --git a/lib/ansible/modules/files/find.py b/lib/ansible/modules/files/find.py index 15f4d6eceda..f7ad3fa6877 100644 --- a/lib/ansible/modules/files/find.py +++ b/lib/ansible/modules/files/find.py @@ -237,7 +237,7 @@ def contentfilter(fsname, pattern): f.close() return True - f.close() + f.close() except: pass diff --git a/lib/ansible/modules/files/patch.py b/lib/ansible/modules/files/patch.py index f09b7b625cf..27534199429 100644 --- a/lib/ansible/modules/files/patch.py +++ b/lib/ansible/modules/files/patch.py @@ -72,7 +72,7 @@ options: backup: version_added: "2.0" description: - - passes --backup --version-control=numbered to patch, + - passes --backup --version-control=numbered to patch, producing numbered backup copies choices: [ 'yes', 'no' ] default: 'no' diff --git a/lib/ansible/modules/monitoring/circonus_annotation.py b/lib/ansible/modules/monitoring/circonus_annotation.py index 5e9029e9fb0..0f9c28c6524 100644 --- a/lib/ansible/modules/monitoring/circonus_annotation.py +++ b/lib/ansible/modules/monitoring/circonus_annotation.py @@ -37,11 +37,11 @@ requirements: options: api_key: description: - - Circonus API key + - Circonus API key required: true category: description: - - Annotation Category + - Annotation Category required: true description: description: diff --git a/lib/ansible/modules/monitoring/logicmonitor.py b/lib/ansible/modules/monitoring/logicmonitor.py index dcb3c70aacf..ca006525242 100644 --- a/lib/ansible/modules/monitoring/logicmonitor.py +++ b/lib/ansible/modules/monitoring/logicmonitor.py @@ -274,7 +274,7 @@ EXAMPLES = ''' company: '{{ company }}' user: '{{ user }}' password: '{{ password }}' - properties: + properties: snmp.community: commstring type: dev @@ -340,7 +340,7 @@ EXAMPLES = ''' password: '{{ password }}' collector: mycompany-Collector groups: /servers/production,/datacenter5 - properties: + properties: snmp.community: commstring dc: 5 delegate_to: localhost @@ -363,7 +363,7 @@ EXAMPLES = ''' company: '{{ company }}' user: '{{ user }}' password: '{{ password }}' - properties: + properties: snmp.community: hg type: dev status: test @@ -474,7 +474,7 @@ EXAMPLES = ''' company: '{{ company }}' user: '{{ user }}' password: '{{ password }}' - properties: + properties: snmp.community: commstring - name: SDT a host group logicmonitor: diff --git a/lib/ansible/modules/monitoring/monit.py b/lib/ansible/modules/monitoring/monit.py index 5e88c7b54d8..c180f79ed35 100644 --- a/lib/ansible/modules/monitoring/monit.py +++ b/lib/ansible/modules/monitoring/monit.py @@ -52,7 +52,7 @@ options: default: 300 version_added: "2.1" requirements: [ ] -author: "Darryl Stoflet (@dstoflet)" +author: "Darryl Stoflet (@dstoflet)" ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/monitoring/pingdom.py b/lib/ansible/modules/monitoring/pingdom.py index d37ae44ab19..a4b77def8c0 100644 --- a/lib/ansible/modules/monitoring/pingdom.py +++ b/lib/ansible/modules/monitoring/pingdom.py @@ -26,7 +26,7 @@ short_description: Pause/unpause Pingdom alerts description: - This module will let you pause/unpause Pingdom alerts version_added: "1.2" -author: +author: - "Dylan Silva (@thaumos)" - "Justin Johns" requirements: diff --git a/lib/ansible/modules/monitoring/sensu_check.py b/lib/ansible/modules/monitoring/sensu_check.py index 77a39647cf6..9c8e702c144 100644 --- a/lib/ansible/modules/monitoring/sensu_check.py +++ b/lib/ansible/modules/monitoring/sensu_check.py @@ -156,7 +156,7 @@ options: custom: version_added: "2.1" description: - - A hash/dictionary of custom parameters for mixing to the configuration. + - A hash/dictionary of custom parameters for mixing to the configuration. - You can't rewrite others module parameters using this required: false default: {} diff --git a/lib/ansible/modules/monitoring/stackdriver.py b/lib/ansible/modules/monitoring/stackdriver.py index b20b1911588..d096b007b17 100644 --- a/lib/ansible/modules/monitoring/stackdriver.py +++ b/lib/ansible/modules/monitoring/stackdriver.py @@ -60,16 +60,16 @@ options: required: false default: null msg: - description: + description: - The contents of the annotation message, in plain text.  Limited to 256 characters. Required for annotation. required: false default: null - annotated_by: + annotated_by: description: - The person or robot who the annotation should be attributed to. required: false default: "Ansible" - level: + level: description: - one of INFO/WARN/ERROR, defaults to INFO if not supplied.  May affect display. choices: ['INFO', 'WARN', 'ERROR'] diff --git a/lib/ansible/modules/monitoring/zabbix_host.py b/lib/ansible/modules/monitoring/zabbix_host.py index 3eef1d0bf1c..254601cfd57 100644 --- a/lib/ansible/modules/monitoring/zabbix_host.py +++ b/lib/ansible/modules/monitoring/zabbix_host.py @@ -222,7 +222,7 @@ class Host(object): if proxy_id: parameters['proxy_hostid'] = proxy_id if visible_name: - parameters['name'] = visible_name + parameters['name'] = visible_name host_list = self._zapi.host.create(parameters) if len(host_list) >= 1: return host_list['hostids'][0] @@ -237,7 +237,7 @@ class Host(object): if proxy_id: parameters['proxy_hostid'] = proxy_id if visible_name: - parameters['name'] = visible_name + parameters['name'] = visible_name self._zapi.host.update(parameters) interface_list_copy = exist_interface_list if interfaces: diff --git a/lib/ansible/modules/monitoring/zabbix_hostmacro.py b/lib/ansible/modules/monitoring/zabbix_hostmacro.py index 54ce0a960f6..694bff2c0b8 100644 --- a/lib/ansible/modules/monitoring/zabbix_hostmacro.py +++ b/lib/ansible/modules/monitoring/zabbix_hostmacro.py @@ -30,7 +30,7 @@ short_description: Zabbix host macro creates/updates/deletes description: - manages Zabbix host macros, it can create, update or delete them. version_added: "2.0" -author: +author: - "(@cave)" - Dean Hailin Song requirements: diff --git a/lib/ansible/modules/network/a10/a10_server.py b/lib/ansible/modules/network/a10/a10_server.py index 3a298cb25f4..6d7e4570b05 100644 --- a/lib/ansible/modules/network/a10/a10_server.py +++ b/lib/ansible/modules/network/a10/a10_server.py @@ -93,7 +93,7 @@ RETURN = ''' EXAMPLES = ''' # Create a new server -- a10_server: +- a10_server: host: a10.mydomain.com username: myadmin password: mypassword diff --git a/lib/ansible/modules/network/a10/a10_server_axapi3.py b/lib/ansible/modules/network/a10/a10_server_axapi3.py index 1dd171481f0..26646286e8f 100644 --- a/lib/ansible/modules/network/a10/a10_server_axapi3.py +++ b/lib/ansible/modules/network/a10/a10_server_axapi3.py @@ -81,7 +81,7 @@ RETURN = ''' EXAMPLES = ''' # Create a new server -- a10_server: +- a10_server: host: a10.mydomain.com username: myadmin password: mypassword diff --git a/lib/ansible/modules/network/a10/a10_service_group.py b/lib/ansible/modules/network/a10/a10_service_group.py index 486fcb0b3e1..a6d8f969daa 100644 --- a/lib/ansible/modules/network/a10/a10_service_group.py +++ b/lib/ansible/modules/network/a10/a10_service_group.py @@ -88,7 +88,7 @@ RETURN = ''' EXAMPLES = ''' # Create a new service-group -- a10_service_group: +- a10_service_group: host: a10.mydomain.com username: myadmin password: mypassword diff --git a/lib/ansible/modules/network/a10/a10_virtual_server.py b/lib/ansible/modules/network/a10/a10_virtual_server.py index 212e65203ac..d4c53ce7939 100644 --- a/lib/ansible/modules/network/a10/a10_virtual_server.py +++ b/lib/ansible/modules/network/a10/a10_virtual_server.py @@ -86,7 +86,7 @@ RETURN = ''' EXAMPLES = ''' # Create a new virtual server -- a10_virtual_server: +- a10_virtual_server: host: a10.mydomain.com username: myadmin password: mypassword diff --git a/lib/ansible/modules/network/basics/get_url.py b/lib/ansible/modules/network/basics/get_url.py index a15b78df4fe..a2658770786 100644 --- a/lib/ansible/modules/network/basics/get_url.py +++ b/lib/ansible/modules/network/basics/get_url.py @@ -173,39 +173,39 @@ author: "Jan-Piet Mens (@jpmens)" EXAMPLES=''' - name: download foo.conf - get_url: - url: http://example.com/path/file.conf - dest: /etc/foo.conf + get_url: + url: http://example.com/path/file.conf + dest: /etc/foo.conf mode: 0440 - name: download file and force basic auth - get_url: - url: http://example.com/path/file.conf - dest: /etc/foo.conf + get_url: + url: http://example.com/path/file.conf + dest: /etc/foo.conf force_basic_auth: yes - name: download file with custom HTTP headers - get_url: - url: http://example.com/path/file.conf - dest: /etc/foo.conf + get_url: + url: http://example.com/path/file.conf + dest: /etc/foo.conf headers: 'key:value,key:value' - name: download file with check (sha256) - get_url: - url: http://example.com/path/file.conf - dest: /etc/foo.conf + get_url: + url: http://example.com/path/file.conf + dest: /etc/foo.conf checksum: sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c - name: download file with check (md5) - get_url: - url: http://example.com/path/file.conf + get_url: + url: http://example.com/path/file.conf dest: /etc/foo.conf checksum: md5:66dffb5228a211e61d6d7ef4a86f5758 - name: download file from a file path - get_url: - url: "file:///tmp/afile.txt" - dest: /tmp/afilecopy.txt + get_url: + url: "file:///tmp/afile.txt" + dest: /tmp/afilecopy.txt ''' from ansible.module_utils.six.moves.urllib.parse import urlsplit @@ -427,7 +427,7 @@ def main(): if os.path.exists(dest): backup_file = module.backup_local(dest) shutil.copyfile(tmpsrc, dest) - except Exception: + except Exception: err = get_exception() os.remove(tmpsrc) module.fail_json(msg="failed to copy %s to %s: %s" % (tmpsrc, dest, str(err))) diff --git a/lib/ansible/modules/network/basics/slurp.py b/lib/ansible/modules/network/basics/slurp.py index f4e00684e7f..594443327c4 100644 --- a/lib/ansible/modules/network/basics/slurp.py +++ b/lib/ansible/modules/network/basics/slurp.py @@ -42,7 +42,7 @@ notes: - This module returns an 'in memory' base64 encoded version of the file, take into account that this will require at least twice the RAM as the original file size. - "See also: M(fetch)" requirements: [] -author: +author: - "Ansible Core Team" - "Michael DeHaan" ''' diff --git a/lib/ansible/modules/network/cloudengine/ce_command.py b/lib/ansible/modules/network/cloudengine/ce_command.py index 0199bd25cda..367913b5068 100644 --- a/lib/ansible/modules/network/cloudengine/ce_command.py +++ b/lib/ansible/modules/network/cloudengine/ce_command.py @@ -37,7 +37,7 @@ extends_documentation_fragment: cloudengine options: commands: description: - - The commands to send to the remote HUAWEI CloudEngine device + - The commands to send to the remote HUAWEI CloudEngine device over the configured provider. The resulting output from the command is returned. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied diff --git a/lib/ansible/modules/network/dellos10/dellos10_facts.py b/lib/ansible/modules/network/dellos10/dellos10_facts.py index 58851d1f009..9666e10d3c0 100644 --- a/lib/ansible/modules/network/dellos10/dellos10_facts.py +++ b/lib/ansible/modules/network/dellos10/dellos10_facts.py @@ -163,13 +163,13 @@ class Default(FactsBase): def populate(self): data = self.runner.get_command('show version | display-xml') - xml_data = ET.fromstring(data) + xml_data = ET.fromstring(data) self.facts['name'] = self.parse_name(xml_data) self.facts['version'] = self.parse_version(xml_data) data = self.runner.get_command('show system | display-xml') - xml_data = ET.fromstring(data) + xml_data = ET.fromstring(data) self.facts['servicetag'] = self.parse_serialnum(xml_data) self.facts['model'] = self.parse_model(xml_data) @@ -178,14 +178,14 @@ class Default(FactsBase): self.facts['hostname'] = self.parse_hostname(data) def parse_name(self, data): - sw_name = data.find('./data/system-sw-state/sw-version/sw-name') + sw_name = data.find('./data/system-sw-state/sw-version/sw-name') if sw_name is not None: return sw_name.text else: return "" def parse_version(self, data): - sw_ver = data.find('./data/system-sw-state/sw-version/sw-version') + sw_ver = data.find('./data/system-sw-state/sw-version/sw-version') if sw_ver is not None: return sw_ver.text else: @@ -197,14 +197,14 @@ class Default(FactsBase): return match.group(1) def parse_model(self, data): - prod_name = data.find('./data/system/node/mfg-info/product-name') + prod_name = data.find('./data/system/node/mfg-info/product-name') if prod_name is not None: return prod_name.text else: return "" def parse_serialnum(self, data): - svc_tag = data.find('./data/system/node/unit/mfg-info/service-tag') + svc_tag = data.find('./data/system/node/unit/mfg-info/service-tag') if svc_tag is not None: return svc_tag.text else: @@ -219,7 +219,7 @@ class Hardware(FactsBase): def populate(self): data = self.runner.get_command('show version | display-xml') - xml_data = ET.fromstring(data) + xml_data = ET.fromstring(data) self.facts['cpu_arch'] = self.parse_cpu_arch(xml_data) @@ -231,7 +231,7 @@ class Hardware(FactsBase): self.facts['memfree_mb'] = int(match[2]) / 1024 def parse_cpu_arch(self, data): - cpu_arch = data.find('./data/system-sw-state/sw-version/cpu-arch') + cpu_arch = data.find('./data/system-sw-state/sw-version/cpu-arch') if cpu_arch is not None: return cpu_arch.text else: @@ -262,7 +262,7 @@ class Interfaces(FactsBase): data = self.runner.get_command('show interface | display-xml') - xml_data = ET.fromstring(data) + xml_data = ET.fromstring(data) self.facts['interfaces'] = self.populate_interfaces(xml_data) self.facts['neighbors'] = self.populate_neighbors(xml_data) @@ -274,11 +274,11 @@ class Interfaces(FactsBase): intf = dict() name = self.parse_item(interface, 'name') - intf['description'] = self.parse_item(interface, 'description') + intf['description'] = self.parse_item(interface, 'description') intf['duplex'] = self.parse_item(interface, 'duplex') - intf['primary_ipv4'] = self.parse_primary_ipv4(interface) + intf['primary_ipv4'] = self.parse_primary_ipv4(interface) intf['secondary_ipv4'] = self.parse_secondary_ipv4(interface) - intf['ipv6'] = self.parse_ipv6_address(interface) + intf['ipv6'] = self.parse_ipv6_address(interface) intf['mtu'] = self.parse_item(interface, 'mtu') intf['type'] = self.parse_item(interface, 'type') @@ -287,7 +287,7 @@ class Interfaces(FactsBase): for interface in interfaces.findall('./data/interfaces-state/interface'): name = self.parse_item(interface, 'name') intf = int_facts[name] - intf['bandwidth'] = self.parse_item(interface, 'speed') + intf['bandwidth'] = self.parse_item(interface, 'speed') intf['adminstatus'] = self.parse_item(interface, 'admin-status') intf['operstatus'] = self.parse_item(interface, 'oper-status') intf['macaddress'] = self.parse_item(interface, 'phys-address') @@ -295,20 +295,20 @@ class Interfaces(FactsBase): for interface in interfaces.findall('./data/ports/ports-state/port'): name = self.parse_item(interface, 'name') fanout = self.parse_item(interface, 'fanout-state') - mediatype = self.parse_item(interface, 'media-type') + mediatype = self.parse_item(interface, 'media-type') typ, sname = name.split('-eth') if fanout == "BREAKOUT_1x1": name = "ethernet" + sname intf = int_facts[name] - intf['mediatype'] = mediatype + intf['mediatype'] = mediatype else: #TODO: Loop for the exact subport for subport in xrange(1, 5): name = "ethernet" + sname + ":" + str(subport) intf = int_facts[name] - intf['mediatype'] = mediatype + intf['mediatype'] = mediatype return int_facts @@ -368,10 +368,10 @@ class Interfaces(FactsBase): fact = dict() fact['host'] = rem_sys_name.text rem_sys_port = interface.find('./lldp-rem-neighbor-info/info/rem-lldp-port-id') - fact['port'] = rem_sys_port.text + fact['port'] = rem_sys_port.text lldp_facts[name].append(fact) - return lldp_facts + return lldp_facts FACT_SUBSETS = dict( default=Default, diff --git a/lib/ansible/modules/network/dellos6/dellos6_facts.py b/lib/ansible/modules/network/dellos6/dellos6_facts.py index 243e04ad666..21c833ed90f 100644 --- a/lib/ansible/modules/network/dellos6/dellos6_facts.py +++ b/lib/ansible/modules/network/dellos6/dellos6_facts.py @@ -236,7 +236,7 @@ class Interfaces(FactsBase): fact['address'] = matc.group(2) fact['masklen'] = matc.group(3) facts[intf].append(fact) - return facts + return facts def populate_interfaces(self, interfaces, desc, properties): facts = dict() diff --git a/lib/ansible/modules/network/dellos9/dellos9_command.py b/lib/ansible/modules/network/dellos9/dellos9_command.py index 303e4d57a7d..110bc1de9c0 100755 --- a/lib/ansible/modules/network/dellos9/dellos9_command.py +++ b/lib/ansible/modules/network/dellos9/dellos9_command.py @@ -77,8 +77,8 @@ notes: - This module requires Dell OS9 version 9.10.0.1P13 or above. - This module requires to increase the ssh connection rate limit. - Use the following command I(ip ssh connection-rate-limit 60) - to configure the same. This can be done via M(dellos9_config) module + Use the following command I(ip ssh connection-rate-limit 60) + to configure the same. This can be done via M(dellos9_config) module as well. """ diff --git a/lib/ansible/modules/network/dellos9/dellos9_config.py b/lib/ansible/modules/network/dellos9/dellos9_config.py index e6f22237c39..637f8f792fc 100755 --- a/lib/ansible/modules/network/dellos9/dellos9_config.py +++ b/lib/ansible/modules/network/dellos9/dellos9_config.py @@ -148,8 +148,8 @@ notes: - This module requires Dell OS9 version 9.10.0.1P13 or above. - This module requires to increase the ssh connection rate limit. - Use the following command I(ip ssh connection-rate-limit 60) - to configure the same. This can be done via M(dellos9_config) module + Use the following command I(ip ssh connection-rate-limit 60) + to configure the same. This can be done via M(dellos9_config) module as well. """ diff --git a/lib/ansible/modules/network/dellos9/dellos9_facts.py b/lib/ansible/modules/network/dellos9/dellos9_facts.py index b5ed8174f88..8f211e6d215 100644 --- a/lib/ansible/modules/network/dellos9/dellos9_facts.py +++ b/lib/ansible/modules/network/dellos9/dellos9_facts.py @@ -51,8 +51,8 @@ notes: - This module requires Dell OS9 version 9.10.0.1P13 or above. - This module requires to increase the ssh connection rate limit. - Use the following command I(ip ssh connection-rate-limit 60) - to configure the same. This can be done via M(dellos9_config) module + Use the following command I(ip ssh connection-rate-limit 60) + to configure the same. This can be done via M(dellos9_config) module as well. """ diff --git a/lib/ansible/modules/network/dnsmadeeasy.py b/lib/ansible/modules/network/dnsmadeeasy.py index bba41159b94..c9425010f11 100644 --- a/lib/ansible/modules/network/dnsmadeeasy.py +++ b/lib/ansible/modules/network/dnsmadeeasy.py @@ -58,7 +58,7 @@ options: default: null record_value: - description: + description: - "Record value. HTTPRED: , MX: , NS: , PTR: , SRV: , TXT: " - "If record_value is not specified; no changes will be made and the record will be returned in 'result' (in other words, this module can be used to fetch a record's current id, type, and ttl)" required: false @@ -87,7 +87,7 @@ options: version_added: 1.5.1 notes: - - The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP. + - The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP. - This module returns record(s) in the "result" element when 'state' is set to 'present'. This value can be be registered and used in your playbooks. requirements: [ hashlib, hmac ] diff --git a/lib/ansible/modules/network/haproxy.py b/lib/ansible/modules/network/haproxy.py index 5ee3006629e..df26da87a20 100644 --- a/lib/ansible/modules/network/haproxy.py +++ b/lib/ansible/modules/network/haproxy.py @@ -295,7 +295,7 @@ class HAProxy(object): """ Wait for a service to reach the specified status. Try RETRIES times with INTERVAL seconds of sleep in between. If the service has not reached - the expected status in that time, the module will fail. If the service was + the expected status in that time, the module will fail. If the service was not found, the module will fail. """ for i in range(1, self.wait_retries): diff --git a/lib/ansible/modules/network/junos/junos_facts.py b/lib/ansible/modules/network/junos/junos_facts.py index 383eb90bcf2..13db4a731ca 100644 --- a/lib/ansible/modules/network/junos/junos_facts.py +++ b/lib/ansible/modules/network/junos/junos_facts.py @@ -49,7 +49,7 @@ options: format of the configuration file. Devices support three configuration file formats. By default, the configuration from the device is returned as text. The other option xml. - If the xml option is chosen, the configuration file is + If the xml option is chosen, the configuration file is returned as both xml and json. required: false default: text diff --git a/lib/ansible/modules/network/lldp.py b/lib/ansible/modules/network/lldp.py index f10c85acde6..29c3f475464 100644 --- a/lib/ansible/modules/network/lldp.py +++ b/lib/ansible/modules/network/lldp.py @@ -31,7 +31,7 @@ description: options: {} author: "Andy Hill (@andyhky)" notes: - - Requires lldpd running and lldp enabled on switches + - Requires lldpd running and lldp enabled on switches ''' EXAMPLES = ''' @@ -83,7 +83,7 @@ def main(): data = {'lldp': lldp_output['lldp']} module.exit_json(ansible_facts=data) except TypeError: - module.fail_json(msg="lldpctl command failed. is lldpd running?") + module.fail_json(msg="lldpctl command failed. is lldpd running?") # import module snippets from ansible.module_utils.basic import * diff --git a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py index 6efe25f6dde..dafd197018e 100644 --- a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py +++ b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py @@ -112,7 +112,7 @@ EXAMPLES = ''' - name: "Tacacs Server Host Configuration" nxos_aaa_server_host: state: present - server_type: tacacs + server_type: tacacs tacacs_port: 89 host_timeout: 10 address: 5.6.7.8 @@ -126,7 +126,7 @@ proposed: description: k/v pairs of parameters passed into module returned: always type: dict - sample: {"address": "1.2.3.4", "auth_port": "2084", + sample: {"address": "1.2.3.4", "auth_port": "2084", "host_timeout": "10", "server_type": "radius"} existing: description: @@ -137,7 +137,7 @@ end_state: description: k/v pairs of configuration after module execution returned: always type: dict - sample: {"address": "1.2.3.4", "auth_port": "2084", + sample: {"address": "1.2.3.4", "auth_port": "2084", "host_timeout": "10", "server_type": "radius"} updates: description: command sent to the device diff --git a/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py b/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py index fbd6ab9c546..b6a443a3201 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp_snooping.py @@ -117,10 +117,10 @@ updates: description: command sent to the device returned: always type: list - sample: ["ip igmp snooping link-local-groups-suppression", - "ip igmp snooping group-timeout 50", - "no ip igmp snooping report-suppression", - "no ip igmp snooping v3-report-suppression", + sample: ["ip igmp snooping link-local-groups-suppression", + "ip igmp snooping group-timeout 50", + "no ip igmp snooping report-suppression", + "no ip igmp snooping v3-report-suppression", "no ip igmp snooping"] changed: description: check to see if a change was made on the device diff --git a/lib/ansible/modules/network/nxos/nxos_install_os.py b/lib/ansible/modules/network/nxos/nxos_install_os.py index aa0c0505437..278afb36d97 100644 --- a/lib/ansible/modules/network/nxos/nxos_install_os.py +++ b/lib/ansible/modules/network/nxos/nxos_install_os.py @@ -69,7 +69,7 @@ EXAMPLES = ''' password: "{{ pwd }}" transport: nxapi rescue: - - name: Wait for device to perform checks + - name: Wait for device to perform checks wait_for: port: 22 state: stopped diff --git a/lib/ansible/modules/network/nxos/nxos_pim_interface.py b/lib/ansible/modules/network/nxos/nxos_pim_interface.py index 4bf3a586257..466294e0079 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_pim_interface.py @@ -153,31 +153,31 @@ proposed: description: k/v pairs of parameters passed into module returned: always type: dict - sample: {"interface": "eth1/33", "neighbor_policy": "test", + sample: {"interface": "eth1/33", "neighbor_policy": "test", "neighbor_type": "routemap", "sparse": true} existing: description: - k/v pairs of existing configuration type: dict - sample: {"border": false, "dr_prio": "1", "hello_interval": "30000", - "isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN", - "jp_policy_out": "1", "jp_type_in": "routemap", - "jp_type_out": null, "neighbor_policy": "test1", + sample: {"border": false, "dr_prio": "1", "hello_interval": "30000", + "isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN", + "jp_policy_out": "1", "jp_type_in": "routemap", + "jp_type_out": null, "neighbor_policy": "test1", "neighbor_type": "prefix", "sparse": true} end_state: description: k/v pairs of configuration after module execution returned: always type: dict - sample: {"border": false, "dr_prio": "1", "hello_interval": "30000", - "isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN", - "jp_policy_out": "1", "jp_type_in": "routemap", - "jp_type_out": null, "neighbor_policy": "test", + sample: {"border": false, "dr_prio": "1", "hello_interval": "30000", + "isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN", + "jp_policy_out": "1", "jp_type_in": "routemap", + "jp_type_out": null, "neighbor_policy": "test", "neighbor_type": "routemap", "sparse": true} updates: description: command sent to the device returned: always type: list - sample: ["interface eth1/33", "ip pim neighbor-policy test", + sample: ["interface eth1/33", "ip pim neighbor-policy test", "ip pim neighbor-policy test"] changed: description: check to see if a change was made on the device diff --git a/lib/ansible/modules/network/nxos/nxos_snmp_host.py b/lib/ansible/modules/network/nxos/nxos_snmp_host.py index 53ae9f3c119..16afb22c01f 100644 --- a/lib/ansible/modules/network/nxos/nxos_snmp_host.py +++ b/lib/ansible/modules/network/nxos/nxos_snmp_host.py @@ -101,7 +101,7 @@ proposed: description: k/v pairs of parameters passed into module returned: always type: dict - sample: {"community": "TESTING", "snmp_host": "3.3.3.3", + sample: {"community": "TESTING", "snmp_host": "3.3.3.3", "snmp_type": "trap", "version": "v2c", "vrf_filter": "one_more_vrf"} existing: description: k/v pairs of existing snmp host diff --git a/lib/ansible/modules/network/nxos/nxos_snmp_user.py b/lib/ansible/modules/network/nxos/nxos_snmp_user.py index c0aa42a75c6..c2c4ccd91a3 100644 --- a/lib/ansible/modules/network/nxos/nxos_snmp_user.py +++ b/lib/ansible/modules/network/nxos/nxos_snmp_user.py @@ -87,19 +87,19 @@ proposed: description: k/v pairs of parameters passed into module returned: always type: dict - sample: {"authentication": "md5", "group": "network-operator", + sample: {"authentication": "md5", "group": "network-operator", "pwd": "test_password", "user": "ntc"} existing: description: - k/v pairs of existing configuration type: dict - sample: {"authentication": "no", "encrypt": "none", + sample: {"authentication": "no", "encrypt": "none", "group": ["network-operator"], "user": "ntc"} end_state: description: k/v pairs configuration vtp after module execution returned: always type: dict - sample: {"authentication": "md5", "encrypt": "none", + sample: {"authentication": "md5", "encrypt": "none", "group": ["network-operator"], "user": "ntc"} updates: description: command sent to the device diff --git a/lib/ansible/modules/network/nxos/nxos_udld_interface.py b/lib/ansible/modules/network/nxos/nxos_udld_interface.py index f106396b506..e36df50bfbd 100644 --- a/lib/ansible/modules/network/nxos/nxos_udld_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_udld_interface.py @@ -97,7 +97,7 @@ updates: description: command sent to the device returned: always type: list - sample: ["interface ethernet1/33", + sample: ["interface ethernet1/33", "no udld aggressive ; no udld disable"] changed: description: check to see if a change was made on the device diff --git a/lib/ansible/modules/network/ovs/openvswitch_port.py b/lib/ansible/modules/network/ovs/openvswitch_port.py index 759a2489c16..1cf38bbe214 100644 --- a/lib/ansible/modules/network/ovs/openvswitch_port.py +++ b/lib/ansible/modules/network/ovs/openvswitch_port.py @@ -81,7 +81,7 @@ EXAMPLES = ''' port: eth2 state: present -# Creates port eth6 +# Creates port eth6 - openvswitch_port: bridge: bridge-loop port: eth6 diff --git a/lib/ansible/modules/notification/flowdock.py b/lib/ansible/modules/notification/flowdock.py index 2d133f9ded3..a16d3041226 100644 --- a/lib/ansible/modules/notification/flowdock.py +++ b/lib/ansible/modules/notification/flowdock.py @@ -26,7 +26,7 @@ DOCUMENTATION = ''' --- module: flowdock version_added: "1.2" -author: "Matt Coddington (@mcodd)" +author: "Matt Coddington (@mcodd)" short_description: Send a message to a flowdock description: - Send a message to a flowdock team inbox or chat using the push API (see https://www.flowdock.com/api/team-inbox and https://www.flowdock.com/api/chat) diff --git a/lib/ansible/modules/notification/irc.py b/lib/ansible/modules/notification/irc.py index f0e842d388e..d36b4c5de03 100644 --- a/lib/ansible/modules/notification/irc.py +++ b/lib/ansible/modules/notification/irc.py @@ -59,7 +59,7 @@ options: version_added: "2.0" color: description: - - Text color for the message. ("none" is a valid option in 1.6 or later, in 1.6 and prior, the default color is black, not "none"). + - Text color for the message. ("none" is a valid option in 1.6 or later, in 1.6 and prior, the default color is black, not "none"). Added 11 more colors in version 2.0. required: false default: "none" diff --git a/lib/ansible/modules/notification/mqtt.py b/lib/ansible/modules/notification/mqtt.py index 2376fddc8ab..78b0b6e921f 100644 --- a/lib/ansible/modules/notification/mqtt.py +++ b/lib/ansible/modules/notification/mqtt.py @@ -115,7 +115,7 @@ requirements: [ mosquitto ] notes: - This module requires a connection to an MQTT broker such as Mosquitto U(http://mosquitto.org) and the I(Paho) C(mqtt) Python client (U(https://pypi.python.org/pypi/paho-mqtt)). -author: "Jan-Piet Mens (@jpmens)" +author: "Jan-Piet Mens (@jpmens)" ''' EXAMPLES = ''' diff --git a/lib/ansible/modules/notification/osx_say.py b/lib/ansible/modules/notification/osx_say.py index ff6d3ae0147..6536025840a 100644 --- a/lib/ansible/modules/notification/osx_say.py +++ b/lib/ansible/modules/notification/osx_say.py @@ -30,7 +30,7 @@ short_description: Makes an OSX computer to speak. description: - makes an OS computer speak! Amuse your friends, annoy your coworkers! notes: - - If you like this module, you may also be interested in the osx_say callback in the plugins/ directory of the source checkout. + - If you like this module, you may also be interested in the osx_say callback in the plugins/ directory of the source checkout. options: msg: description: @@ -41,7 +41,7 @@ options: What voice to use required: false requirements: [ say ] -author: +author: - "Ansible Core Team" - "Michael DeHaan (@mpdehaan)" ''' @@ -76,7 +76,7 @@ def main(): say(module, msg, voice) - module.exit_json(msg=msg, changed=False) + module.exit_json(msg=msg, changed=False) # import module snippets from ansible.module_utils.basic import * diff --git a/lib/ansible/modules/notification/pushbullet.py b/lib/ansible/modules/notification/pushbullet.py index 8000ae73420..6a1151b8ba8 100644 --- a/lib/ansible/modules/notification/pushbullet.py +++ b/lib/ansible/modules/notification/pushbullet.py @@ -70,13 +70,13 @@ notes: EXAMPLES = ''' # Sends a push notification to a device -- pushbullet: +- pushbullet: api_key: "ABC123abc123ABC123abc123ABC123ab" device: "Chrome" title: "You may see this on Google Chrome" # Sends a link to a device -- pushbullet: +- pushbullet: api_key: ABC123abc123ABC123abc123ABC123ab device: Chrome push_type: link @@ -84,13 +84,13 @@ EXAMPLES = ''' body: http://docs.ansible.com/ # Sends a push notification to a channel -- pushbullet: +- pushbullet: api_key: ABC123abc123ABC123abc123ABC123ab channel: my-awesome-channel title: Broadcasting a message to the #my-awesome-channel folks # Sends a push notification with title and body to a channel -- pushbullet: +- pushbullet: api_key: ABC123abc123ABC123abc123ABC123ab channel: my-awesome-channel title: ALERT! Signup service is down @@ -137,7 +137,7 @@ def main(): if not pushbullet_found: module.fail_json(msg="Python 'pushbullet.py' module is required. Install via: $ pip install pushbullet.py") - # Init pushbullet + # Init pushbullet try: pb = PushBullet(api_key) target = None diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index 796ef979c8a..5afbfde6e6a 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -776,7 +776,7 @@ def get_cache(module): if rc == 0: break if rc != 0: - module.fail_json(msg='Updating the cache to correct corrupt package lists failed:\n%s\n%s' % (str(e), str(so) + str(se))) + module.fail_json(msg='Updating the cache to correct corrupt package lists failed:\n%s\n%s' % (str(e), str(so) + str(se))) # try again cache = apt.Cache() else: diff --git a/lib/ansible/modules/packaging/os/apt_rpm.py b/lib/ansible/modules/packaging/os/apt_rpm.py index e0d0e2ca50f..f800073ea4c 100755 --- a/lib/ansible/modules/packaging/os/apt_rpm.py +++ b/lib/ansible/modules/packaging/os/apt_rpm.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # (c) 2013, Evgenii Terechkov -# Written by Evgenii Terechkov -# Based on urpmi module written by Philippe Makowski +# Written by Evgenii Terechkov +# Based on urpmi module written by Philippe Makowski # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/lib/ansible/modules/packaging/os/homebrew.py b/lib/ansible/modules/packaging/os/homebrew.py index e381f1a3d87..0d7a13a189a 100755 --- a/lib/ansible/modules/packaging/os/homebrew.py +++ b/lib/ansible/modules/packaging/os/homebrew.py @@ -179,7 +179,7 @@ class Homebrew(object): \+ # plusses - # dashes : # colons (for URLs) - @ # at-sign + @ # at-sign ''' INVALID_PATH_REGEX = _create_regex_group(VALID_PATH_CHARS) diff --git a/lib/ansible/modules/packaging/os/layman.py b/lib/ansible/modules/packaging/os/layman.py index f18189f69c1..9c46cf31902 100644 --- a/lib/ansible/modules/packaging/os/layman.py +++ b/lib/ansible/modules/packaging/os/layman.py @@ -157,7 +157,7 @@ def install_overlay(module, name, list_url=None): layman = init_layman(layman_conf) if layman.is_installed(name): - return False + return False if module.check_mode: mymsg = 'Would add layman repo \'' + name + '\'' diff --git a/lib/ansible/modules/packaging/os/pkgng.py b/lib/ansible/modules/packaging/os/pkgng.py index df5a9713a44..4b6eac739c2 100644 --- a/lib/ansible/modules/packaging/os/pkgng.py +++ b/lib/ansible/modules/packaging/os/pkgng.py @@ -4,7 +4,7 @@ # (c) 2013, bleader # Written by bleader # Based on pkgin module written by Shaun Zinck -# that was based on pacman module written by Afterburn +# that was based on pacman module written by Afterburn # that was based on apt module written by Matthew Williams # # This module is free software: you can redistribute it and/or modify @@ -86,7 +86,7 @@ options: required: false choices: [ "yes", "no" ] default: no -author: "bleader (@bleader)" +author: "bleader (@bleader)" notes: - When using pkgsite, be careful that already in cache packages won't be downloaded again. ''' @@ -102,7 +102,7 @@ EXAMPLES = ''' name: foo,bar annotation: '+test1=baz,-test2,:test3=foobar' -# Remove packages foo and bar +# Remove packages foo and bar - pkgng: name: foo,bar state: absent diff --git a/lib/ansible/modules/packaging/os/pkgutil.py b/lib/ansible/modules/packaging/os/pkgutil.py index a54e96eeb08..18654d13f3d 100644 --- a/lib/ansible/modules/packaging/os/pkgutil.py +++ b/lib/ansible/modules/packaging/os/pkgutil.py @@ -27,7 +27,7 @@ ANSIBLE_METADATA = {'status': ['stableinterface'], DOCUMENTATION = ''' --- -module: pkgutil +module: pkgutil short_description: Manage CSW-Packages on Solaris description: - Manages CSW packages (SVR4 format) on Solaris 10 and 11. @@ -112,7 +112,7 @@ def package_install(module, state, name, site, update_catalog): if site is not None: cmd += [ '-t', site ] if state == 'latest': - cmd += [ '-f' ] + cmd += [ '-f' ] cmd.append(name) (rc, out, err) = run_command(module, cmd) return (rc, out, err) @@ -186,7 +186,7 @@ def main(): else: if not package_latest(module, name, site): if module.check_mode: - module.exit_json(changed=True) + module.exit_json(changed=True) (rc, out, err) = package_upgrade(module, name, site, update_catalog) if len(out) > 75: out = out[:75] + '...' diff --git a/lib/ansible/modules/packaging/os/svr4pkg.py b/lib/ansible/modules/packaging/os/svr4pkg.py index 81409e3b2dd..69ab3763859 100644 --- a/lib/ansible/modules/packaging/os/svr4pkg.py +++ b/lib/ansible/modules/packaging/os/svr4pkg.py @@ -157,7 +157,7 @@ def run_command(module, cmd): def package_install(module, name, src, proxy, response_file, zone, category): adminfile = create_admin_file() - cmd = [ 'pkgadd', '-n'] + cmd = [ 'pkgadd', '-n'] if zone == 'current': cmd += [ '-G' ] cmd += [ '-a', adminfile, '-d', src ] diff --git a/lib/ansible/modules/packaging/os/urpmi.py b/lib/ansible/modules/packaging/os/urpmi.py index 597fc2eaa50..300bb29570d 100644 --- a/lib/ansible/modules/packaging/os/urpmi.py +++ b/lib/ansible/modules/packaging/os/urpmi.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # (c) 2013, Philippe Makowski -# Written by Philippe Makowski +# Written by Philippe Makowski # Based on apt module written by Matthew Williams # # This module is free software: you can redistribute it and/or modify @@ -76,16 +76,16 @@ EXAMPLES = ''' pkg: foo state: absent -# description: remove packages foo and bar +# description: remove packages foo and bar - urpmi: pkg: foo,bar state: absent -# description: update the package database (urpmi.update -a -q) and install bar (bar will be the updated if a newer version exists) +# description: update the package database (urpmi.update -a -q) and install bar (bar will be the updated if a newer version exists) - urpmi: name: bar state: present - update_cache: yes + update_cache: yes ''' diff --git a/lib/ansible/modules/packaging/os/yum.py b/lib/ansible/modules/packaging/os/yum.py index 6f42b963942..800c9fd0220 100644 --- a/lib/ansible/modules/packaging/os/yum.py +++ b/lib/ansible/modules/packaging/os/yum.py @@ -434,7 +434,7 @@ def is_update(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=None, dis_r if not pkgs: e,m,u = my.pkgSack.matchPackageNames([pkgspec]) pkgs = e + m - updates = my.doPackageLists(pkgnarrow='updates').updates + updates = my.doPackageLists(pkgnarrow='updates').updates except Exception: e = get_exception() module.fail_json(msg="Failure talking to yum: %s" % e) @@ -524,9 +524,9 @@ def what_provides(module, repoq, req_spec, conf_file, qf=def_qf, en_repos=None, return set() def transaction_exists(pkglist): - """ - checks the package list to see if any packages are - involved in an incomplete transaction + """ + checks the package list to see if any packages are + involved in an incomplete transaction """ conflicts = [] @@ -824,7 +824,7 @@ def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, in res['results'].append(out) res['msg'] = err - # compile the results into one batch. If anything is changed + # compile the results into one batch. If anything is changed # then mark changed # at the end - if we've end up failed then fail out of the rest # of the process diff --git a/lib/ansible/modules/packaging/os/zypper_repository.py b/lib/ansible/modules/packaging/os/zypper_repository.py index adad2bc195d..879d9807c2f 100644 --- a/lib/ansible/modules/packaging/os/zypper_repository.py +++ b/lib/ansible/modules/packaging/os/zypper_repository.py @@ -87,7 +87,7 @@ options: version_added: "2.1" auto_import_keys: description: - - Automatically import the gpg signing key of the new or changed repository. + - Automatically import the gpg signing key of the new or changed repository. - Has an effect only if state is I(present). Has no effect on existing (unchanged) repositories or in combination with I(absent). - Implies runrefresh. required: false @@ -111,7 +111,7 @@ options: version_added: "2.2" -requirements: +requirements: - "zypper >= 1.0 # included in openSuSE >= 11.1 or SuSE Linux Enterprise Server/Desktop >= 11.0" - python-xml ''' @@ -246,7 +246,7 @@ def addmodify_repo(module, repodata, old_repos, zypper_version, warnings): cmd.extend(['--name', repodata['name']]) # priority on addrepo available since 1.12.25 - # https://github.com/openSUSE/zypper/blob/b9b3cb6db76c47dc4c47e26f6a4d2d4a0d12b06d/package/zypper.changes#L327-L336 + # https://github.com/openSUSE/zypper/blob/b9b3cb6db76c47dc4c47e26f6a4d2d4a0d12b06d/package/zypper.changes#L327-L336 if repodata['priority']: if zypper_version >= LooseVersion('1.12.25'): cmd.extend(['--priority', str(repodata['priority'])]) diff --git a/lib/ansible/modules/remote_management/stacki/stacki_host.py b/lib/ansible/modules/remote_management/stacki/stacki_host.py index cf971d37e45..d80e7d1f17c 100644 --- a/lib/ansible/modules/remote_management/stacki/stacki_host.py +++ b/lib/ansible/modules/remote_management/stacki/stacki_host.py @@ -65,21 +65,21 @@ author: "Hugh Ma " EXAMPLES = ''' - name: Add a host named test-1 - stacki_host: - name: test-1 - stacki_user: usr - stacki_password: pwd + stacki_host: + name: test-1 + stacki_user: usr + stacki_password: pwd stacki_endpoint: url - prim_intf_mac: mac_addr - prim_intf_ip: x.x.x.x + prim_intf_mac: mac_addr + prim_intf_ip: x.x.x.x prim_intf: eth0 - name: Remove a host named test-1 - stacki_host: + stacki_host: name: test-1 - stacki_user: usr - stacki_password: pwd - stacki_endpoint: url + stacki_user: usr + stacki_password: pwd + stacki_endpoint: url state: absent ''' @@ -129,7 +129,7 @@ class StackiHost: 'PASSWORD': module.params['stacki_password']} # Get Intial CSRF - cred_a = self.do_request(self.module, self.endpoint, method="GET") + cred_a = self.do_request(self.module, self.endpoint, method="GET") cookie_a = cred_a.headers.get('Set-Cookie').split(';') init_csrftoken = None for c in cookie_a: @@ -147,7 +147,7 @@ class StackiHost: # Get Final CSRF and Session ID login_req = self.do_request(self.module, login_endpoint, headers=header, - payload=urllib.urlencode(auth_creds), method="POST") + payload=urllib.urlencode(auth_creds), method="POST") cookie_f = login_req.headers.get('Set-Cookie').split(';') csrftoken = None @@ -177,7 +177,7 @@ class StackiHost: def stack_check_host(self): res = self.do_request(self.module, self.endpoint, payload=json.dumps({"cmd": "list host"}), - headers=self.header, method="POST") + headers=self.header, method="POST") if self.hostname in res.read(): return True @@ -215,7 +215,7 @@ class StackiHost: data['cmd'] = "add host interface {0} interface={1} ip={2} network={3} mac={4} default=true"\ .format(self.hostname, self.prim_intf, self.prim_intf_ip, self.network, self.prim_intf_mac) - res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), + res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), headers=self.header, method="POST") @@ -226,7 +226,7 @@ class StackiHost: data['cmd'] = "add host {0} rack={1} rank={2} appliance={3}"\ .format(self.hostname, self.rack, self.rank, self.appliance) - res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), + res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), headers=self.header, method="POST") self.stack_sync() @@ -241,7 +241,7 @@ class StackiHost: data['cmd'] = "remove host {0}"\ .format(self.hostname) - res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), + res = self.do_request(self.module, self.endpoint, payload=json.dumps(data), headers=self.header, method="POST") self.stack_sync() diff --git a/lib/ansible/modules/source_control/hg.py b/lib/ansible/modules/source_control/hg.py index 89845c197c9..b4a7c6514ff 100644 --- a/lib/ansible/modules/source_control/hg.py +++ b/lib/ansible/modules/source_control/hg.py @@ -91,8 +91,8 @@ options: the normal mechanism for resolving binary paths will be used. notes: - "If the task seems to be hanging, first verify remote host is in C(known_hosts). - SSH will prompt user to authorize the first contact with a remote host. To avoid this prompt, - one solution is to add the remote host public key in C(/etc/ssh/ssh_known_hosts) before calling + SSH will prompt user to authorize the first contact with a remote host. To avoid this prompt, + one solution is to add the remote host public key in C(/etc/ssh/ssh_known_hosts) before calling the hg module, with the following command: ssh-keyscan remote_host.com >> /etc/ssh/ssh_known_hosts." requirements: [ ] ''' diff --git a/lib/ansible/modules/storage/infinidat/infini_export.py b/lib/ansible/modules/storage/infinidat/infini_export.py index 683234426aa..f974c74c2cc 100644 --- a/lib/ansible/modules/storage/infinidat/infini_export.py +++ b/lib/ansible/modules/storage/infinidat/infini_export.py @@ -62,8 +62,8 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Export bar filesystem under foo pool as /data - infini_export: - name: /data01 + infini_export: + name: /data01 filesystem: foo user: admin password: secret diff --git a/lib/ansible/modules/storage/infinidat/infini_export_client.py b/lib/ansible/modules/storage/infinidat/infini_export_client.py index 1dcde6305dd..1fd515c2e71 100644 --- a/lib/ansible/modules/storage/infinidat/infini_export_client.py +++ b/lib/ansible/modules/storage/infinidat/infini_export_client.py @@ -75,10 +75,10 @@ EXAMPLES = ''' system: ibox001 - name: Add multiple clients with RO access. Squash root priviledges - infini_export_client: + infini_export_client: client: "{{ item }}" access_mode: RO - no_root_squash: no + no_root_squash: no export: /data user: admin password: secret diff --git a/lib/ansible/modules/storage/infinidat/infini_pool.py b/lib/ansible/modules/storage/infinidat/infini_pool.py index 7fd4839503c..ad14bba71f8 100644 --- a/lib/ansible/modules/storage/infinidat/infini_pool.py +++ b/lib/ansible/modules/storage/infinidat/infini_pool.py @@ -76,11 +76,11 @@ EXAMPLES = ''' system: ibox001 - name: Disable SSD Cache on pool - infini_pool: - name: foo - ssd_cache: no - user: admin - password: secret + infini_pool: + name: foo + ssd_cache: no + user: admin + password: secret system: ibox001 ''' diff --git a/lib/ansible/modules/system/capabilities.py b/lib/ansible/modules/system/capabilities.py index 27f3c7519cc..33ea9b665ed 100644 --- a/lib/ansible/modules/system/capabilities.py +++ b/lib/ansible/modules/system/capabilities.py @@ -86,7 +86,7 @@ class CapabilitiesModule(object): distribution = None def __init__(self, module): - self.module = module + self.module = module self.path = module.params['path'].strip() self.capability = module.params['capability'].strip().lower() self.state = module.params['state'] @@ -124,7 +124,7 @@ class CapabilitiesModule(object): def getcap(self, path): rval = [] cmd = "%s -v %s" % (self.getcap_cmd, path) - rc, stdout, stderr = self.module.run_command(cmd) + rc, stdout, stderr = self.module.run_command(cmd) # If file xattrs are set but no caps are set the output will be: # '/foo =' # If file xattrs are unset the output will be: @@ -151,7 +151,7 @@ class CapabilitiesModule(object): def setcap(self, path, caps): caps = ' '.join([ ''.join(cap) for cap in caps ]) cmd = "%s '%s' %s" % (self.setcap_cmd, caps, path) - rc, stdout, stderr = self.module.run_command(cmd) + rc, stdout, stderr = self.module.run_command(cmd) if rc != 0: self.module.fail_json(msg="Unable to set capabilities of %s" % path, stdout=stdout, stderr=stderr) else: diff --git a/lib/ansible/modules/system/facter.py b/lib/ansible/modules/system/facter.py index 5ae13ab7371..10e314b3352 100644 --- a/lib/ansible/modules/system/facter.py +++ b/lib/ansible/modules/system/facter.py @@ -36,7 +36,7 @@ version_added: "0.2" options: {} notes: [] requirements: [ "facter", "ruby-json" ] -author: +author: - "Ansible Core Team" - "Michael DeHaan" ''' diff --git a/lib/ansible/modules/system/lvg.py b/lib/ansible/modules/system/lvg.py index 9c638f4d317..ad15d50e258 100644 --- a/lib/ansible/modules/system/lvg.py +++ b/lib/ansible/modules/system/lvg.py @@ -39,7 +39,7 @@ options: pvs: description: - List of comma-separated devices to use as physical devices in this volume group. Required when creating or resizing volume group. - - The module will take care of running pvcreate if needed. + - The module will take care of running pvcreate if needed. required: false pesize: description: diff --git a/lib/ansible/modules/system/modprobe.py b/lib/ansible/modules/system/modprobe.py index d84f0d3377d..0094a6270f9 100644 --- a/lib/ansible/modules/system/modprobe.py +++ b/lib/ansible/modules/system/modprobe.py @@ -30,7 +30,7 @@ short_description: Add or remove kernel modules requirements: [] version_added: 1.4 author: - - "David Stygstra (@stygstra)" + - "David Stygstra (@stygstra)" - "Julien Dauphant" - "Matt Jeffery" description: diff --git a/lib/ansible/modules/system/ohai.py b/lib/ansible/modules/system/ohai.py index 47926a34d12..b17c9ea88f4 100644 --- a/lib/ansible/modules/system/ohai.py +++ b/lib/ansible/modules/system/ohai.py @@ -29,14 +29,14 @@ module: ohai short_description: Returns inventory data from I(Ohai) description: - Similar to the M(facter) module, this runs the I(Ohai) discovery program - (U(http://wiki.opscode.com/display/chef/Ohai)) on the remote host and + (U(http://wiki.opscode.com/display/chef/Ohai)) on the remote host and returns JSON inventory data. I(Ohai) data is a bit more verbose and nested than I(facter). version_added: "0.6" options: {} notes: [] requirements: [ "ohai" ] -author: +author: - "Ansible Core Team" - "Michael DeHaan (@mpdehaan)" ''' diff --git a/lib/ansible/modules/system/setup.py b/lib/ansible/modules/system/setup.py index 81bbf43ddba..5fa8c321e3d 100644 --- a/lib/ansible/modules/system/setup.py +++ b/lib/ansible/modules/system/setup.py @@ -79,9 +79,9 @@ notes: - The filter option filters only the first level subkey below ansible_facts. - If the target host is Windows, you will not currently have the ability to use C(filter) as this is provided by a simpler implementation of the module. - - If the target host is Windows you can now use C(fact_path). Make sure that this path - exists on the target host. Files in this path MUST be PowerShell scripts (``*.ps1``) and - their output must be formattable in JSON (Ansible will take care of this). Test the + - If the target host is Windows you can now use C(fact_path). Make sure that this path + exists on the target host. Files in this path MUST be PowerShell scripts (``*.ps1``) and + their output must be formattable in JSON (Ansible will take care of this). Test the output of your scripts. This option was added in Ansible 2.1. author: diff --git a/lib/ansible/modules/system/sysctl.py b/lib/ansible/modules/system/sysctl.py index 8a270b43870..763c48e6b5c 100644 --- a/lib/ansible/modules/system/sysctl.py +++ b/lib/ansible/modules/system/sysctl.py @@ -123,7 +123,7 @@ from ansible.module_utils.basic import get_platform, get_exception, AnsibleModul class SysctlModule(object): def __init__(self, module): - self.module = module + self.module = module self.args = self.module.params self.sysctl_cmd = self.module.get_bin_path('sysctl', required=True) @@ -176,11 +176,11 @@ class SysctlModule(object): self.write_file = True # use the sysctl command or not? - if self.args['sysctl_set']: + if self.args['sysctl_set']: if self.proc_value is None: self.changed = True elif not self._values_is_equal(self.proc_value, self.args['value']): - self.changed = True + self.changed = True self.set_proc = True # Do the work @@ -229,14 +229,14 @@ class SysctlModule(object): # SYSCTL COMMAND MANAGEMENT # ============================================================== - # Use the sysctl command to find the current value + # Use the sysctl command to find the current value def get_token_curr_value(self, token): if self.platform == 'openbsd': # openbsd doesn't support -e, just drop it thiscmd = "%s -n %s" % (self.sysctl_cmd, token) else: thiscmd = "%s -e -n %s" % (self.sysctl_cmd, token) - rc,out,err = self.module.run_command(thiscmd) + rc,out,err = self.module.run_command(thiscmd) if rc != 0: return None else: @@ -282,7 +282,7 @@ class SysctlModule(object): rc,out,err = self.module.run_command(sysctl_args) - if rc != 0: + if rc != 0: self.module.fail_json(msg="Failed to reload sysctl: %s" % str(out) + str(err)) # ============================================================== @@ -292,7 +292,7 @@ class SysctlModule(object): # Get the token value from the sysctl file def read_sysctl_file(self): - lines = [] + lines = [] if os.path.isfile(self.sysctl_file): try: f = open(self.sysctl_file, "r") @@ -308,7 +308,7 @@ class SysctlModule(object): # don't split empty lines or comments if not line or line.startswith("#"): - continue + continue k, v = line.split('=',1) k = k.strip() @@ -323,7 +323,7 @@ class SysctlModule(object): if not line.strip() or line.strip().startswith("#"): self.fixed_lines.append(line) continue - tmpline = line.strip() + tmpline = line.strip() k, v = line.split('=',1) k = k.strip() v = v.strip() @@ -332,14 +332,14 @@ class SysctlModule(object): if k == self.args['name']: if self.args['state'] == "present": new_line = "%s=%s\n" % (k, self.args['value']) - self.fixed_lines.append(new_line) + self.fixed_lines.append(new_line) else: new_line = "%s=%s\n" % (k, v) - self.fixed_lines.append(new_line) + self.fixed_lines.append(new_line) if self.args['name'] not in checked and self.args['state'] == "present": new_line = "%s=%s\n" % (self.args['name'], self.args['value']) - self.fixed_lines.append(new_line) + self.fixed_lines.append(new_line) # Completely rewrite the sysctl file def write_sysctl(self): @@ -356,7 +356,7 @@ class SysctlModule(object): f.close() # replace the real one - self.module.atomic_move(tmp_path, self.sysctl_file) + self.module.atomic_move(tmp_path, self.sysctl_file) # ============================================================== diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index 2b7ad349e70..1b3198de4b9 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -368,8 +368,8 @@ class User(object): cmd.append(self.group) elif self.group_exists(self.name): # use the -N option (no user group) if a group already - # exists with the same name as the user to prevent - # errors from useradd trying to create a group when + # exists with the same name as the user to prevent + # errors from useradd trying to create a group when # USERGROUPS_ENAB is set in /etc/login.defs. if os.path.exists('/etc/redhat-release'): dist = platform.dist() @@ -922,7 +922,7 @@ class FreeBsdUser(User): self.module.get_bin_path('chpass', True), '-p', self.password, - self.name + self.name ] return self.execute_command(cmd) @@ -1258,7 +1258,7 @@ class SunOS(User): """ This is a SunOS User manipulation class - The main difference between this class and the generic user class is that Solaris-type distros - don't support the concept of a "system" account and we need to + don't support the concept of a "system" account and we need to edit the /etc/shadow file manually to set a password. (Ugh) This overrides the following methods from the generic class:- diff --git a/lib/ansible/modules/utilities/helper/_accelerate.py b/lib/ansible/modules/utilities/helper/_accelerate.py index ff14877a3df..9c8f3e80deb 100644 --- a/lib/ansible/modules/utilities/helper/_accelerate.py +++ b/lib/ansible/modules/utilities/helper/_accelerate.py @@ -60,7 +60,7 @@ options: default: false multi_key: description: - - When enabled, the daemon will open a local socket file which can be used by future daemon executions to + - When enabled, the daemon will open a local socket file which can be used by future daemon executions to upload a new key to the already running daemon, so that multiple users can connect using different keys. This access still requires an ssh connection as the uid for which the daemon is currently running. required: false @@ -110,13 +110,13 @@ from threading import Thread, Lock # we must import this here at the top so we can use get_module_path() from ansible.module_utils.basic import * -# the chunk size to read and send, assuming mtu 1500 and +# the chunk size to read and send, assuming mtu 1500 and # leaving room for base64 (+33%) encoding and header (100 bytes) -# 4 * (975/3) + 100 = 1400 +# 4 * (975/3) + 100 = 1400 # which leaves room for the TCP/IP header CHUNK_SIZE=10240 -# FIXME: this all should be moved to module_common, as it's +# FIXME: this all should be moved to module_common, as it's # pretty much a copy from the callbacks/util code DEBUG_LEVEL=0 def log(msg, cap=0): @@ -148,7 +148,7 @@ SOCKET_FILE = os.path.join(get_module_path(), '.ansible-accelerate', ".local.soc def get_pid_location(module): """ - Try to find a pid directory in the common locations, falling + Try to find a pid directory in the common locations, falling back to the user's home directory if no others exist """ for dir in ['/var/run', '/var/lib/run', '/run', os.path.expanduser("~/")]: diff --git a/lib/ansible/modules/utilities/logic/assert.py b/lib/ansible/modules/utilities/logic/assert.py index 875fc6e8565..49f82bd8144 100644 --- a/lib/ansible/modules/utilities/logic/assert.py +++ b/lib/ansible/modules/utilities/logic/assert.py @@ -25,7 +25,7 @@ ANSIBLE_METADATA = {'status': ['stableinterface'], DOCUMENTATION = ''' --- module: assert -short_description: Asserts given expressions are true +short_description: Asserts given expressions are true description: - This module asserts that given expressions are true with an optional custom message. version_added: "1.5" @@ -39,7 +39,7 @@ options: description: - "The customized message used for a failing assertion" required: false -author: +author: - "Ansible Core Team" - "Michael DeHaan" ''' @@ -47,13 +47,13 @@ author: EXAMPLES = ''' - assert: { that: "ansible_os_family != 'RedHat'" } -- assert: - that: - - "'foo' in some_command_result.stdout" +- assert: + that: + - "'foo' in some_command_result.stdout" - "number_of_the_counting == 3" -- assert: - that: +- assert: + that: - "my_param <= 100" - "my_param >= 0" msg: "'my_param' must be between 0 and 100" diff --git a/lib/ansible/modules/utilities/logic/async_status.py b/lib/ansible/modules/utilities/logic/async_status.py index 7093cd32db7..768af1012e8 100644 --- a/lib/ansible/modules/utilities/logic/async_status.py +++ b/lib/ansible/modules/utilities/logic/async_status.py @@ -47,7 +47,7 @@ options: notes: - See also U(http://docs.ansible.com/playbooks_async.html) requirements: [] -author: +author: - "Ansible Core Team" - "Michael DeHaan" ''' diff --git a/lib/ansible/modules/utilities/logic/wait_for.py b/lib/ansible/modules/utilities/logic/wait_for.py index a3ae8e17c6e..8c234fa343a 100644 --- a/lib/ansible/modules/utilities/logic/wait_for.py +++ b/lib/ansible/modules/utilities/logic/wait_for.py @@ -433,7 +433,7 @@ def main(): if params['exclude_hosts'] is not None and state != 'drained': module.fail_json(msg="exclude_hosts should only be with state=drained") for _connection_state in params['active_connection_states']: - try: + try: get_connection_state_id(_connection_state) except: module.fail_json(msg="unknown active_connection_state ("+_connection_state+") defined") diff --git a/lib/ansible/modules/web_infrastructure/jira.py b/lib/ansible/modules/web_infrastructure/jira.py index 64877f0f6e6..a3b229d024a 100755 --- a/lib/ansible/modules/web_infrastructure/jira.py +++ b/lib/ansible/modules/web_infrastructure/jira.py @@ -249,7 +249,7 @@ def request(url, user, passwd, data=None, method=None): # inject the basic-auth header up-front to ensure that JIRA treats # the requests as authorized for this user. auth = base64.encodestring('%s:%s' % (user, passwd)).replace('\n', '') - response, info = fetch_url(module, url, data=data, method=method, + response, info = fetch_url(module, url, data=data, method=method, headers={'Content-Type':'application/json', 'Authorization':"Basic %s" % auth}) @@ -288,7 +288,7 @@ def create(restbase, user, passwd, params): url = restbase + '/issue/' - ret = post(url, user, passwd, data) + ret = post(url, user, passwd, data) return ret @@ -310,16 +310,16 @@ def edit(restbase, user, passwd, params): 'fields': params['fields'] } - url = restbase + '/issue/' + params['issue'] + url = restbase + '/issue/' + params['issue'] - ret = put(url, user, passwd, data) + ret = put(url, user, passwd, data) return ret def fetch(restbase, user, passwd, params): url = restbase + '/issue/' + params['issue'] - ret = get(url, user, passwd) + ret = get(url, user, passwd) return ret diff --git a/lib/ansible/modules/web_infrastructure/letsencrypt.py b/lib/ansible/modules/web_infrastructure/letsencrypt.py index 0027cb6e707..946f7fb338b 100644 --- a/lib/ansible/modules/web_infrastructure/letsencrypt.py +++ b/lib/ansible/modules/web_infrastructure/letsencrypt.py @@ -111,7 +111,7 @@ options: - "The number of days the certificate must have left being valid. If C(cert_days < remaining_days), then it will be renewed. If the certificate is not renewed, module return values will not - include C(challenge_data)." + include C(challenge_data)." required: false default: 10 ''' diff --git a/lib/ansible/modules/windows/win_command.py b/lib/ansible/modules/windows/win_command.py index a42cb1b7120..d528137550c 100644 --- a/lib/ansible/modules/windows/win_command.py +++ b/lib/ansible/modules/windows/win_command.py @@ -55,7 +55,7 @@ notes: M(win_command) module is much more secure as it's not affected by the user's environment. - " C(creates), C(removes), and C(chdir) can be specified after the command. For instance, if you only want to run a command if a certain file does not exist, use this." -author: +author: - Matt Davis ''' diff --git a/lib/ansible/modules/windows/win_package.py b/lib/ansible/modules/windows/win_package.py index f66364aeb70..5bcbc88417b 100644 --- a/lib/ansible/modules/windows/win_package.py +++ b/lib/ansible/modules/windows/win_package.py @@ -109,7 +109,7 @@ EXAMPLES = r''' productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}' arguments: '/q /norestart' ensure: present - expected_return_code: 3010 + expected_return_code: 3010 # Specify multiple non-zero return codes when successful # In this case we can say that both 0 (SUCCESSFUL) and 3010 (REBOOT REQUIRED) codes are acceptable diff --git a/lib/ansible/modules/windows/win_regmerge.py b/lib/ansible/modules/windows/win_regmerge.py index 91d16f217f6..80582c750d1 100644 --- a/lib/ansible/modules/windows/win_regmerge.py +++ b/lib/ansible/modules/windows/win_regmerge.py @@ -63,7 +63,7 @@ notes: EXAMPLES = r''' # Merge in a registry file without comparing to current registry - # Note that paths using / to separate are preferred as they require less special handling than \ + # Note that paths using / to separate are preferred as they require less special handling than \ win_regmerge: path: C:/autodeploy/myCompany-settings.reg # Compare and merge registry file diff --git a/lib/ansible/playbook/block.py b/lib/ansible/playbook/block.py index 5b9585238c1..71f074da757 100644 --- a/lib/ansible/playbook/block.py +++ b/lib/ansible/playbook/block.py @@ -142,13 +142,13 @@ class Block(Base, Become, Conditional, Taggable): def _load_always(self, attr, ds): try: return load_list_of_tasks( - ds, + ds, play=self._play, - block=self, - role=self._role, + block=self, + role=self._role, task_include=None, - variable_manager=self._variable_manager, - loader=self._loader, + variable_manager=self._variable_manager, + loader=self._loader, use_handlers=self._use_handlers, ) except AssertionError: diff --git a/lib/ansible/playbook/role/metadata.py b/lib/ansible/playbook/role/metadata.py index d62f2526acb..a9206605ade 100644 --- a/lib/ansible/playbook/role/metadata.py +++ b/lib/ansible/playbook/role/metadata.py @@ -68,20 +68,20 @@ class RoleMetadata(Base): roles = [] if ds: if not isinstance(ds, list): - raise AnsibleParserError("Expected role dependencies to be a list.", obj=self._ds) + raise AnsibleParserError("Expected role dependencies to be a list.", obj=self._ds) - for role_def in ds: + for role_def in ds: if isinstance(role_def, string_types) or 'role' in role_def or 'name' in role_def: - roles.append(role_def) + roles.append(role_def) continue - try: + try: # role_def is new style: { src: 'galaxy.role,version,name', other_vars: "here" } def_parsed = RoleRequirement.role_yaml_parse(role_def) if def_parsed.get('name'): - role_def['name'] = def_parsed['name'] - roles.append(role_def) + role_def['name'] = def_parsed['name'] + roles.append(role_def) except AnsibleError as exc: - raise AnsibleParserError(str(exc), obj=role_def) + raise AnsibleParserError(str(exc), obj=role_def) current_role_path = None if self._owner: diff --git a/lib/ansible/plugins/callback/profile_tasks.py b/lib/ansible/plugins/callback/profile_tasks.py index 51c50c8c2a1..a8a4742e0dd 100644 --- a/lib/ansible/plugins/callback/profile_tasks.py +++ b/lib/ansible/plugins/callback/profile_tasks.py @@ -1,4 +1,4 @@ -# (C) 2016, Joel, http://github.com/jjshoe +# (C) 2016, Joel, http://github.com/jjshoe # (C) 2015, Tom Paine, # (C) 2014, Jharrod LaFon, @JharrodLaFon # (C) 2012-2013, Michael DeHaan, @@ -87,7 +87,7 @@ class CallbackModule(CallbackBase): if self.task_output_limit == 'all': self.task_output_limit = None else: - self.task_output_limit = int(self.task_output_limit) + self.task_output_limit = int(self.task_output_limit) super(CallbackModule, self).__init__() @@ -119,7 +119,7 @@ class CallbackModule(CallbackBase): timestamp(self) - results = self.stats.items() + results = self.stats.items() # Sort the tasks by the specified sort if self.sort_order != 'none': @@ -129,7 +129,7 @@ class CallbackModule(CallbackBase): reverse=self.sort_order, ) - # Display the number of tasks specified or the default of 20 + # Display the number of tasks specified or the default of 20 results = results[:self.task_output_limit] # Print the timings diff --git a/lib/ansible/plugins/callback/syslog_json.py b/lib/ansible/plugins/callback/syslog_json.py index 85257ca1705..2d67c09d16b 100644 --- a/lib/ansible/plugins/callback/syslog_json.py +++ b/lib/ansible/plugins/callback/syslog_json.py @@ -38,7 +38,7 @@ class CallbackModule(CallbackBase): self.handler = logging.handlers.SysLogHandler( address = (os.getenv('SYSLOG_SERVER','localhost'), - os.getenv('SYSLOG_PORT',514)), + os.getenv('SYSLOG_PORT',514)), facility= os.getenv('SYSLOG_FACILITY',logging.handlers.SysLogHandler.LOG_USER) ) self.logger.addHandler(self.handler) diff --git a/lib/ansible/plugins/lookup/first_found.py b/lib/ansible/plugins/lookup/first_found.py index fc302bf26e7..1e6a17be8e0 100644 --- a/lib/ansible/plugins/lookup/first_found.py +++ b/lib/ansible/plugins/lookup/first_found.py @@ -36,7 +36,7 @@ __metaclass__ = type # EXAMPLES # - name: copy first existing file found to /some/file # action: copy src=$item dest=/some/file -# with_first_found: +# with_first_found: # - files: foo ${inventory_hostname} bar # paths: /tmp/production /tmp/staging @@ -50,7 +50,7 @@ __metaclass__ = type # - name: copy first existing file found to /some/file # action: copy src=$item dest=/some/file -# with_first_found: +# with_first_found: # - files: /some/place/foo ${inventory_hostname} /some/place/else # that will look for files in this order: @@ -102,7 +102,7 @@ __metaclass__ = type # - templates # the above will return an empty list if the files cannot be found at all -# if skip is unspecificed or if it is set to false then it will return a list +# if skip is unspecificed or if it is set to false then it will return a list # error which can be caught bye ignore_errors: true for that action. # finally - if you want you can use it, in place to replace first_available_file: diff --git a/lib/ansible/plugins/lookup/pipe.py b/lib/ansible/plugins/lookup/pipe.py index 71b0ed97774..306e3afb7a4 100644 --- a/lib/ansible/plugins/lookup/pipe.py +++ b/lib/ansible/plugins/lookup/pipe.py @@ -31,8 +31,8 @@ class LookupModule(LookupBase): ''' http://docs.python.org/2/library/subprocess.html#popen-constructor - The shell argument (which defaults to False) specifies whether to use the - shell as the program to execute. If shell is True, it is recommended to pass + The shell argument (which defaults to False) specifies whether to use the + shell as the program to execute. If shell is True, it is recommended to pass args as a string rather than as a sequence https://github.com/ansible/ansible/issues/6550 diff --git a/lib/ansible/plugins/lookup/random_choice.py b/lib/ansible/plugins/lookup/random_choice.py index de4f31cd0eb..fccc2f4e092 100644 --- a/lib/ansible/plugins/lookup/random_choice.py +++ b/lib/ansible/plugins/lookup/random_choice.py @@ -28,7 +28,7 @@ from ansible.plugins.lookup import LookupBase # - debug: msg=$item # with_random_choice: # - one -# - two +# - two # - three class LookupModule(LookupBase): diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py index 5451108241e..ebbdd255e42 100644 --- a/lib/ansible/plugins/strategy/__init__.py +++ b/lib/ansible/plugins/strategy/__init__.py @@ -385,7 +385,7 @@ class StrategyBase: self._tqm._stats.increment('failures', original_host.name) # grab the current state and if we're iterating on the rescue portion - # of a block then we save the failed task in a special var for use + # of a block then we save the failed task in a special var for use # within the rescue/always state, _ = iterator.get_next_task_for_host(original_host, peek=True) diff --git a/lib/ansible/utils/helpers.py b/lib/ansible/utils/helpers.py index 549cc4a1465..02a60ee53a5 100644 --- a/lib/ansible/utils/helpers.py +++ b/lib/ansible/utils/helpers.py @@ -24,7 +24,7 @@ from ansible.compat.six import string_types def pct_to_int(value, num_items, min_value=1): ''' Converts a given value to a percentage if specified as "x%", - otherwise converts the given value to an integer. + otherwise converts the given value to an integer. ''' if isinstance(value, string_types) and value.endswith('%'): value_pct = int(value.replace("%","")) diff --git a/lib/ansible/utils/module_docs_fragments/auth_basic.py b/lib/ansible/utils/module_docs_fragments/auth_basic.py index 4150919937b..c46790b63e9 100644 --- a/lib/ansible/utils/module_docs_fragments/auth_basic.py +++ b/lib/ansible/utils/module_docs_fragments/auth_basic.py @@ -38,5 +38,5 @@ options: required: false default: yes description: - - Whether or not to validate SSL certs when supplying a https endpoint. + - Whether or not to validate SSL certs when supplying a https endpoint. """ diff --git a/lib/ansible/utils/module_docs_fragments/aws.py b/lib/ansible/utils/module_docs_fragments/aws.py index 7a999d78590..dcc35977763 100644 --- a/lib/ansible/utils/module_docs_fragments/aws.py +++ b/lib/ansible/utils/module_docs_fragments/aws.py @@ -73,7 +73,7 @@ notes: C(AWS_SECURITY_TOKEN) or C(EC2_SECURITY_TOKEN), C(AWS_REGION) or C(EC2_REGION) - Ansible uses the boto configuration file (typically ~/.boto) if no - credentials are provided. See http://boto.readthedocs.org/en/latest/boto_config_tut.html - - C(AWS_REGION) or C(EC2_REGION) can be typically be used to specify the + credentials are provided. See http://boto.readthedocs.org/en/latest/boto_config_tut.html + - C(AWS_REGION) or C(EC2_REGION) can be typically be used to specify the AWS region, when required, but this can also be configured in the boto config file """ diff --git a/lib/ansible/utils/module_docs_fragments/cloudengine.py b/lib/ansible/utils/module_docs_fragments/cloudengine.py index e04678ab652..46369a6f2b9 100644 --- a/lib/ansible/utils/module_docs_fragments/cloudengine.py +++ b/lib/ansible/utils/module_docs_fragments/cloudengine.py @@ -38,8 +38,8 @@ options: username: description: - Configures the username to use to authenticate the connection to - the remote device. This value is used to authenticate the CLI login. - If the value is not specified in the task, the value of environment + the remote device. This value is used to authenticate the CLI login. + If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_USERNAME) will be used instead. required: false password: diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 16013a74292..30cb12a9cd7 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -6,7 +6,6 @@ contrib/inventory/consul_io.py contrib/inventory/digital_ocean.py contrib/inventory/docker.py contrib/inventory/ec2.py -contrib/inventory/freeipa.py contrib/inventory/gce.py contrib/inventory/linode.py contrib/inventory/mdt_dynamic_inventory.py @@ -41,10 +40,8 @@ lib/ansible/executor/stats.py lib/ansible/executor/task_executor.py lib/ansible/galaxy/login.py lib/ansible/galaxy/role.py -lib/ansible/galaxy/token.py lib/ansible/inventory/dir.py lib/ansible/inventory/script.py -lib/ansible/inventory/yaml.py lib/ansible/module_utils/azure_rm_common.py lib/ansible/module_utils/basic.py lib/ansible/module_utils/docker_common.py @@ -95,7 +92,6 @@ lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py lib/ansible/modules/cloud/amazon/ec2_vpc_net.py lib/ansible/modules/cloud/amazon/ec2_vpc_net_facts.py -lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py lib/ansible/modules/cloud/amazon/ec2_vpc_route_table_facts.py lib/ansible/modules/cloud/amazon/ec2_vpc_subnet.py @@ -128,7 +124,6 @@ lib/ansible/modules/cloud/amazon/s3_lifecycle.py lib/ansible/modules/cloud/amazon/s3_sync.py lib/ansible/modules/cloud/amazon/s3_website.py lib/ansible/modules/cloud/amazon/sns_topic.py -lib/ansible/modules/cloud/amazon/sqs_queue.py lib/ansible/modules/cloud/amazon/sts_assume_role.py lib/ansible/modules/cloud/amazon/sts_session_token.py lib/ansible/modules/cloud/atomic/atomic_host.py @@ -156,7 +151,6 @@ lib/ansible/modules/cloud/docker/docker_container.py lib/ansible/modules/cloud/docker/docker_image.py lib/ansible/modules/cloud/docker/docker_service.py lib/ansible/modules/cloud/google/gc_storage.py -lib/ansible/modules/cloud/google/gcdns_record.py lib/ansible/modules/cloud/google/gce_img.py lib/ansible/modules/cloud/google/gce_lb.py lib/ansible/modules/cloud/google/gce_mig.py @@ -172,12 +166,10 @@ lib/ansible/modules/cloud/misc/proxmox_kvm.py lib/ansible/modules/cloud/misc/proxmox_template.py lib/ansible/modules/cloud/misc/serverless.py lib/ansible/modules/cloud/misc/virt.py -lib/ansible/modules/cloud/misc/virt_net.py lib/ansible/modules/cloud/misc/xenserver_facts.py lib/ansible/modules/cloud/openstack/_glance_image.py lib/ansible/modules/cloud/openstack/_keystone_user.py lib/ansible/modules/cloud/openstack/_nova_compute.py -lib/ansible/modules/cloud/openstack/_nova_keypair.py lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py lib/ansible/modules/cloud/openstack/_quantum_network.py @@ -186,15 +178,12 @@ lib/ansible/modules/cloud/openstack/_quantum_router_gateway.py lib/ansible/modules/cloud/openstack/_quantum_router_interface.py lib/ansible/modules/cloud/openstack/_quantum_subnet.py lib/ansible/modules/cloud/openstack/os_auth.py -lib/ansible/modules/cloud/openstack/os_client_config.py lib/ansible/modules/cloud/openstack/os_nova_host_aggregate.py lib/ansible/modules/cloud/openstack/os_object.py lib/ansible/modules/cloud/openstack/os_project.py -lib/ansible/modules/cloud/openstack/os_project_facts.py lib/ansible/modules/cloud/openstack/os_quota.py lib/ansible/modules/cloud/openstack/os_recordset.py lib/ansible/modules/cloud/openstack/os_zone.py -lib/ansible/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py lib/ansible/modules/cloud/packet/packet_device.py lib/ansible/modules/cloud/packet/packet_sshkey.py lib/ansible/modules/cloud/profitbricks/profitbricks.py @@ -202,17 +191,10 @@ lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py lib/ansible/modules/cloud/profitbricks/profitbricks_nic.py lib/ansible/modules/cloud/profitbricks/profitbricks_volume.py lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py -lib/ansible/modules/cloud/rackspace/rax_cbs.py -lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py -lib/ansible/modules/cloud/rackspace/rax_clb.py -lib/ansible/modules/cloud/rackspace/rax_identity.py -lib/ansible/modules/cloud/rackspace/rax_network.py -lib/ansible/modules/cloud/rackspace/rax_queue.py lib/ansible/modules/cloud/softlayer/sl_vm.py lib/ansible/modules/cloud/vmware/vca_fw.py lib/ansible/modules/cloud/vmware/vmware_guest.py lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py -lib/ansible/modules/cloud/vmware/vsphere_copy.py lib/ansible/modules/cloud/vmware/vsphere_guest.py lib/ansible/modules/cloud/webfaction/webfaction_app.py lib/ansible/modules/cloud/webfaction/webfaction_db.py @@ -227,7 +209,6 @@ lib/ansible/modules/commands/command.py lib/ansible/modules/commands/script.py lib/ansible/modules/crypto/openssl_publickey.py lib/ansible/modules/database/influxdb/influxdb_retention_policy.py -lib/ansible/modules/database/misc/kibana_plugin.py lib/ansible/modules/database/misc/mongodb_parameter.py lib/ansible/modules/database/misc/mongodb_user.py lib/ansible/modules/database/misc/redis.py @@ -239,7 +220,6 @@ lib/ansible/modules/database/mysql/mysql_user.py lib/ansible/modules/database/mysql/mysql_variables.py lib/ansible/modules/database/postgresql/postgresql_db.py lib/ansible/modules/database/postgresql/postgresql_ext.py -lib/ansible/modules/database/postgresql/postgresql_lang.py lib/ansible/modules/database/postgresql/postgresql_privs.py lib/ansible/modules/database/postgresql/postgresql_schema.py lib/ansible/modules/database/postgresql/postgresql_user.py @@ -252,7 +232,6 @@ lib/ansible/modules/files/copy.py lib/ansible/modules/files/find.py lib/ansible/modules/files/ini_file.py lib/ansible/modules/files/lineinfile.py -lib/ansible/modules/files/patch.py lib/ansible/modules/files/stat.py lib/ansible/modules/files/synchronize.py lib/ansible/modules/files/tempfile.py @@ -266,31 +245,19 @@ lib/ansible/modules/monitoring/datadog_monitor.py lib/ansible/modules/monitoring/librato_annotation.py lib/ansible/modules/monitoring/logicmonitor.py lib/ansible/modules/monitoring/logicmonitor_facts.py -lib/ansible/modules/monitoring/monit.py lib/ansible/modules/monitoring/nagios.py lib/ansible/modules/monitoring/pagerduty.py lib/ansible/modules/monitoring/pagerduty_alert.py lib/ansible/modules/monitoring/pingdom.py lib/ansible/modules/monitoring/sensu_check.py -lib/ansible/modules/monitoring/stackdriver.py lib/ansible/modules/monitoring/statusio_maintenance.py -lib/ansible/modules/monitoring/zabbix_host.py -lib/ansible/modules/monitoring/zabbix_hostmacro.py lib/ansible/modules/monitoring/zabbix_screen.py lib/ansible/modules/network/a10/a10_server.py lib/ansible/modules/network/a10/a10_server_axapi3.py lib/ansible/modules/network/a10/a10_service_group.py -lib/ansible/modules/network/a10/a10_virtual_server.py -lib/ansible/modules/network/basics/get_url.py lib/ansible/modules/network/basics/slurp.py lib/ansible/modules/network/basics/uri.py -lib/ansible/modules/network/cloudengine/ce_command.py lib/ansible/modules/network/cloudflare_dns.py -lib/ansible/modules/network/dellos10/dellos10_facts.py -lib/ansible/modules/network/dellos6/dellos6_facts.py -lib/ansible/modules/network/dellos9/dellos9_command.py -lib/ansible/modules/network/dellos9/dellos9_config.py -lib/ansible/modules/network/dellos9/dellos9_facts.py lib/ansible/modules/network/dnsimple.py lib/ansible/modules/network/dnsmadeeasy.py lib/ansible/modules/network/exoscale/exo_dns_record.py @@ -301,8 +268,6 @@ lib/ansible/modules/network/f5/bigip_pool.py lib/ansible/modules/network/f5/bigip_pool_member.py lib/ansible/modules/network/f5/bigip_virtual_server.py lib/ansible/modules/network/haproxy.py -lib/ansible/modules/network/junos/junos_facts.py -lib/ansible/modules/network/lldp.py lib/ansible/modules/network/nmcli.py lib/ansible/modules/network/nxos/nxos_aaa_server.py lib/ansible/modules/network/nxos/nxos_aaa_server_host.py @@ -364,15 +329,9 @@ lib/ansible/modules/network/nxos/nxos_vtp_password.py lib/ansible/modules/network/nxos/nxos_vtp_version.py lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py -lib/ansible/modules/network/ovs/openvswitch_port.py lib/ansible/modules/network/panos/panos_nat_policy.py lib/ansible/modules/network/snmp_facts.py -lib/ansible/modules/notification/flowdock.py lib/ansible/modules/notification/hall.py -lib/ansible/modules/notification/irc.py -lib/ansible/modules/notification/mqtt.py -lib/ansible/modules/notification/osx_say.py -lib/ansible/modules/notification/pushbullet.py lib/ansible/modules/notification/sendgrid.py lib/ansible/modules/notification/sns.py lib/ansible/modules/packaging/language/bundler.py @@ -393,25 +352,18 @@ lib/ansible/modules/packaging/os/pacman.py lib/ansible/modules/packaging/os/pkg5_publisher.py lib/ansible/modules/packaging/os/pkgin.py lib/ansible/modules/packaging/os/pkgng.py -lib/ansible/modules/packaging/os/pkgutil.py lib/ansible/modules/packaging/os/portinstall.py lib/ansible/modules/packaging/os/redhat_subscription.py lib/ansible/modules/packaging/os/rhn_channel.py lib/ansible/modules/packaging/os/rhn_register.py lib/ansible/modules/packaging/os/rpm_key.py -lib/ansible/modules/packaging/os/svr4pkg.py lib/ansible/modules/packaging/os/swdepot.py lib/ansible/modules/packaging/os/urpmi.py lib/ansible/modules/packaging/os/yum.py lib/ansible/modules/packaging/os/zypper.py -lib/ansible/modules/packaging/os/zypper_repository.py lib/ansible/modules/remote_management/foreman/katello.py lib/ansible/modules/remote_management/stacki/stacki_host.py lib/ansible/modules/source_control/github_hooks.py -lib/ansible/modules/source_control/hg.py -lib/ansible/modules/storage/infinidat/infini_export.py -lib/ansible/modules/storage/infinidat/infini_export_client.py -lib/ansible/modules/storage/infinidat/infini_pool.py lib/ansible/modules/storage/netapp/netapp_e_amg.py lib/ansible/modules/storage/netapp/netapp_e_amg_sync.py lib/ansible/modules/storage/netapp/netapp_e_auth.py @@ -422,10 +374,8 @@ lib/ansible/modules/storage/netapp/netapp_e_snapshot_volume.py lib/ansible/modules/storage/netapp/netapp_e_storage_system.py lib/ansible/modules/storage/netapp/netapp_e_storagepool.py lib/ansible/modules/system/authorized_key.py -lib/ansible/modules/system/capabilities.py lib/ansible/modules/system/cron.py lib/ansible/modules/system/debconf.py -lib/ansible/modules/system/facter.py lib/ansible/modules/system/filesystem.py lib/ansible/modules/system/firewalld.py lib/ansible/modules/system/gconftool2.py @@ -433,24 +383,16 @@ lib/ansible/modules/system/gluster_volume.py lib/ansible/modules/system/group.py lib/ansible/modules/system/known_hosts.py lib/ansible/modules/system/locale_gen.py -lib/ansible/modules/system/lvg.py lib/ansible/modules/system/lvol.py -lib/ansible/modules/system/modprobe.py -lib/ansible/modules/system/ohai.py lib/ansible/modules/system/openwrt_init.py lib/ansible/modules/system/pam_limits.py lib/ansible/modules/system/sefcontext.py lib/ansible/modules/system/seport.py -lib/ansible/modules/system/setup.py lib/ansible/modules/system/solaris_zone.py -lib/ansible/modules/system/sysctl.py lib/ansible/modules/system/systemd.py lib/ansible/modules/system/ufw.py lib/ansible/modules/system/user.py -lib/ansible/modules/utilities/helper/_accelerate.py lib/ansible/modules/utilities/helper/meta.py -lib/ansible/modules/utilities/logic/assert.py -lib/ansible/modules/utilities/logic/async_status.py lib/ansible/modules/utilities/logic/include.py lib/ansible/modules/utilities/logic/include_role.py lib/ansible/modules/utilities/logic/include_vars.py @@ -462,7 +404,6 @@ lib/ansible/modules/web_infrastructure/apache2_module.py lib/ansible/modules/web_infrastructure/django_manage.py lib/ansible/modules/web_infrastructure/jenkins_job.py lib/ansible/modules/web_infrastructure/jira.py -lib/ansible/modules/web_infrastructure/letsencrypt.py lib/ansible/modules/web_infrastructure/nginx_status_facts.py lib/ansible/modules/web_infrastructure/taiga_issue.py lib/ansible/modules/windows/win_acl.py @@ -507,7 +448,6 @@ lib/ansible/plugins/callback/logentries.py lib/ansible/plugins/callback/oneline.py lib/ansible/plugins/callback/profile_tasks.py lib/ansible/plugins/callback/selective.py -lib/ansible/plugins/callback/syslog_json.py lib/ansible/plugins/connection/accelerate.py lib/ansible/plugins/connection/paramiko_ssh.py lib/ansible/plugins/connection/ssh.py @@ -520,8 +460,6 @@ lib/ansible/plugins/lookup/dnstxt.py lib/ansible/plugins/lookup/first_found.py lib/ansible/plugins/lookup/hashi_vault.py lib/ansible/plugins/lookup/mongodb.py -lib/ansible/plugins/lookup/pipe.py -lib/ansible/plugins/lookup/random_choice.py lib/ansible/plugins/lookup/sequence.py lib/ansible/plugins/shell/fish.py lib/ansible/plugins/shell/sh.py @@ -531,12 +469,9 @@ lib/ansible/plugins/strategy/linear.py lib/ansible/template/__init__.py lib/ansible/utils/cmd_functions.py lib/ansible/utils/encrypt.py -lib/ansible/utils/helpers.py lib/ansible/utils/module_docs.py -lib/ansible/utils/module_docs_fragments/auth_basic.py lib/ansible/utils/module_docs_fragments/aws.py lib/ansible/utils/module_docs_fragments/azure_tags.py -lib/ansible/utils/module_docs_fragments/cloudengine.py lib/ansible/utils/module_docs_fragments/ec2.py lib/ansible/utils/module_docs_fragments/files.py lib/ansible/utils/module_docs_fragments/infinibox.py @@ -549,10 +484,8 @@ test/integration/cleanup_ec2.py test/integration/cleanup_gce.py test/integration/setup_gce.py test/units/cli/test_galaxy.py -test/units/contrib/inventory/test_vmware_inventory.py test/units/errors/test_errors.py test/units/executor/test_playbook_executor.py -test/units/executor/test_task_executor.py test/units/mock/yaml_helper.py test/units/module_utils/basic/test__log_invocation.py test/units/module_utils/basic/test_exit_json.py @@ -570,14 +503,10 @@ test/units/parsing/test_mod_args.py test/units/parsing/yaml/test_loader.py test/units/playbook/test_block.py test/units/playbook/test_helpers.py -test/units/playbook/test_play.py test/units/playbook/test_play_context.py test/units/playbook/test_task.py -test/units/plugins/action/test_raw.py -test/units/plugins/action/test_synchronize.py test/units/plugins/lookup/test_ini.py test/units/plugins/lookup/test_password.py -test/units/plugins/strategy/test_strategy_base.py test/units/template/test_templar.py test/units/template/test_template_utilities.py test/units/utils/test_vars.py diff --git a/test/sanity/pep8/legacy-ignore.txt b/test/sanity/pep8/legacy-ignore.txt index ff6aba80466..05512ff0ab4 100644 --- a/test/sanity/pep8/legacy-ignore.txt +++ b/test/sanity/pep8/legacy-ignore.txt @@ -15,4 +15,3 @@ E711 E712 E721 W191 -W291 diff --git a/test/units/contrib/inventory/test_vmware_inventory.py b/test/units/contrib/inventory/test_vmware_inventory.py index 5c5a8511126..d13332d93e8 100644 --- a/test/units/contrib/inventory/test_vmware_inventory.py +++ b/test/units/contrib/inventory/test_vmware_inventory.py @@ -54,7 +54,7 @@ class TestVMWareInventory(unittest.TestCase): vmw = VMWareInventory(load=False) vmw.args = fakeargs vmw.inventory = BASICINVENTORY - showdata = vmw.show() + showdata = vmw.show() serializable = False try: @@ -71,7 +71,7 @@ class TestVMWareInventory(unittest.TestCase): vmw.args = fakeargs vmw.args.list = True vmw.inventory = BASICINVENTORY - showdata = vmw.show() + showdata = vmw.show() serializable = False try: @@ -88,7 +88,7 @@ class TestVMWareInventory(unittest.TestCase): vmw.args = fakeargs vmw.args.list = True vmw.inventory = BASICINVENTORY - showdata = vmw.show() + showdata = vmw.show() expected = json.dumps(BASICINVENTORY, indent=2) assert showdata == expected @@ -98,7 +98,7 @@ class TestVMWareInventory(unittest.TestCase): vmw.args = fakeargs vmw.args.host = 'foo' vmw.inventory = BASICINVENTORY - showdata = vmw.show() + showdata = vmw.show() serializable = False try: @@ -116,7 +116,7 @@ class TestVMWareInventory(unittest.TestCase): vmw.args.list = False vmw.args.host = 'foo' vmw.inventory = BASICINVENTORY - showdata = vmw.show() + showdata = vmw.show() expected = BASICINVENTORY['_meta']['hostvars']['foo'] expected = json.dumps(expected, indent=2) #import epdb; epdb.st() diff --git a/test/units/executor/test_task_executor.py b/test/units/executor/test_task_executor.py index 60935692d5a..59b773bbff3 100644 --- a/test/units/executor/test_task_executor.py +++ b/test/units/executor/test_task_executor.py @@ -260,7 +260,7 @@ class TestTaskExecutor(unittest.TestCase): # you can't use a list as a dict key so that would probably throw # an error later. If so, we can throw it now instead. # Squashing in this case would not be intuitive as the user is being - # explicit in using each list entry as a key. + # explicit in using each list entry as a key. job_vars = dict(pkg_mgr='yum', packages={ "a": "foo", "b": "bar", "foo": "baz", "bar": "quux" }) items = [['a', 'b'], ['foo', 'bar']] mock_task.action = 'yum' diff --git a/test/units/module_utils/test_distribution_version.py b/test/units/module_utils/test_distribution_version.py index 584ac710c0c..9e67a604122 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -174,19 +174,19 @@ ID_LIKE="suse" }, { "platform.dist": [ - "", - "", + "", + "", "" - ], + ], "input": { "/etc/os-release": "NAME=\"openSUSE Tumbleweed\"\n# VERSION=\"20160917\"\nID=opensuse\nID_LIKE=\"suse\"\nVERSION_ID=\"20160917\"\nPRETTY_NAME=\"openSUSE Tumbleweed\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:opensuse:tumbleweed:20160917\"\nBUG_REPORT_URL=\"https://bugs.opensuse.org\"\nHOME_URL=\"https://www.opensuse.org/\"\n" - }, - "name": "openSUSE Tumbleweed 20160917", + }, + "name": "openSUSE Tumbleweed 20160917", "result": { - "distribution_release": "NA", - "distribution": "openSUSE Tumbleweed", - "distribution_major_version": "NA", - "os_family": "Suse", + "distribution_release": "NA", + "distribution": "openSUSE Tumbleweed", + "distribution_major_version": "NA", + "os_family": "Suse", "distribution_version": "20160917" } }, diff --git a/test/units/playbook/test_play.py b/test/units/playbook/test_play.py index eb96248884a..064fbd2aa7c 100644 --- a/test/units/playbook/test_play.py +++ b/test/units/playbook/test_play.py @@ -77,7 +77,7 @@ class TestPlay(unittest.TestCase): name="test play", hosts=['foo'], gather_facts=False, - tasks=[dict(action='shell echo "hello world"')], + tasks=[dict(action='shell echo "hello world"')], )) def test_play_with_handlers(self): diff --git a/test/units/plugins/action/test_raw.py b/test/units/plugins/action/test_raw.py index 5564a934b29..c48d38b4379 100644 --- a/test/units/plugins/action/test_raw.py +++ b/test/units/plugins/action/test_raw.py @@ -32,8 +32,8 @@ class TestCopyResultExclude(unittest.TestCase): def tearDown(self): pass - # The current behavior of the raw aciton in regards to executable is currently in question; - # the test_raw_executable_is_not_empty_string verifies the current behavior (whether it is desireed or not. + # The current behavior of the raw aciton in regards to executable is currently in question; + # the test_raw_executable_is_not_empty_string verifies the current behavior (whether it is desireed or not. # Please refer to the following for context: # Issue: https://github.com/ansible/ansible/issues/16054 # PR: https://github.com/ansible/ansible/pull/16085 diff --git a/test/units/plugins/action/test_synchronize.py b/test/units/plugins/action/test_synchronize.py index 4c435843927..0d20da29c54 100644 --- a/test/units/plugins/action/test_synchronize.py +++ b/test/units/plugins/action/test_synchronize.py @@ -32,7 +32,7 @@ safe_vars = {} for k,v in task_vars.items(): if k not in ['vars', 'hostvars']: safe_vars[k] = copy.deepcopy(v) - else: + else: sdata = str(v) newv = eval(sdata) safe_vars[k] = newv @@ -46,7 +46,7 @@ with open('task_vars.json', 'wb') as f: class TaskMock(object): - args = {'src': u'/tmp/deleteme', + args = {'src': u'/tmp/deleteme', 'dest': '/tmp/deleteme', 'rsync_path': 'rsync'} async = None @@ -82,7 +82,7 @@ class ModuleLoaderMock(object): pass class SharedLoaderMock(object): - module_loader = ModuleLoaderMock() + module_loader = ModuleLoaderMock() class SynchronizeTester(object): @@ -139,19 +139,19 @@ class SynchronizeTester(object): self.task.args[k] = v # load inital task vars - invarspath = os.path.join(fixturepath, + invarspath = os.path.join(fixturepath, test_meta.get('fixtures', {}).get('taskvars_in', 'taskvars_in.json')) with open(invarspath, 'rb') as f: fdata = f.read() - fdata = fdata.decode("utf-8") + fdata = fdata.decode("utf-8") in_task_vars = json.loads(fdata) # load expected final task vars - outvarspath = os.path.join(fixturepath, + outvarspath = os.path.join(fixturepath, test_meta.get('fixtures', {}).get('taskvars_out', 'taskvars_out.json')) with open(outvarspath, 'rb') as f: fdata = f.read() - fdata = fdata.decode("utf-8") + fdata = fdata.decode("utf-8") out_task_vars = json.loads(fdata) # fixup the connection @@ -164,7 +164,7 @@ class SynchronizeTester(object): in_task_vars['hostvars'][k] = v # initalize and run the module - SAM = ActionModule(self.task, self.connection, self._play_context, + SAM = ActionModule(self.task, self.connection, self._play_context, self.loader, self.templar, self.shared_loader_obj) SAM._execute_module = self._execute_module result = SAM.run(task_vars=in_task_vars) diff --git a/test/units/plugins/strategy/test_strategy_base.py b/test/units/plugins/strategy/test_strategy_base.py index c9c305e0b13..03f827df141 100644 --- a/test/units/plugins/strategy/test_strategy_base.py +++ b/test/units/plugins/strategy/test_strategy_base.py @@ -311,7 +311,7 @@ class TestStrategyBase(unittest.TestCase): strategy_base._blocked_hosts = dict() def _has_dead_workers(): - return False + return False strategy_base._tqm.has_dead_workers.side_effect = _has_dead_workers results = strategy_base._wait_on_pending_results(iterator=mock_iterator)