mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Assorted pylint fixes
This commit is contained in:
parent
8e0f95951d
commit
f9ab9b4d68
65 changed files with 343 additions and 473 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.com>
|
||||
#
|
||||
# -*- coding: utf-8 -*
|
||||
|
||||
# Copyright: (c) 2017, Julien Stroheker <juliens@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -545,7 +545,7 @@ class AzureRMContainerService(AzureRMModuleBase):
|
|||
|
||||
mastercount = self.master_profile[0].get('count')
|
||||
if mastercount != 1 and mastercount != 3 and mastercount != 5:
|
||||
self.fail('Master Count number wrong : {} / should be 1 3 or 5'.format(mastercount))
|
||||
self.fail('Master Count number wrong : {0} / should be 1 3 or 5'.format(mastercount))
|
||||
|
||||
# For now Agent Pool cannot be more than 1, just remove this part in the future if it change
|
||||
agentpoolcount = len(self.agent_pool_profiles)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2016 Julien Stroheker, <juliens@microsoft.com>
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2016, Julien Stroheker <juliens@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -126,7 +126,7 @@ class AzureRMAvailabilitySetFacts(AzureRMModuleBase):
|
|||
def get_item(self):
|
||||
"""Get a single availability set"""
|
||||
|
||||
self.log('Get properties for {}'.format(self.name))
|
||||
self.log('Get properties for {0}'.format(self.name))
|
||||
|
||||
item = None
|
||||
result = []
|
||||
|
@ -153,7 +153,7 @@ class AzureRMAvailabilitySetFacts(AzureRMModuleBase):
|
|||
try:
|
||||
response = self.compute_client.availability_sets.list(self.resource_group)
|
||||
except CloudError as exc:
|
||||
self.fail('Failed to list all items - {}'.format(str(exc)))
|
||||
self.fail('Failed to list all items - {0}'.format(str(exc)))
|
||||
|
||||
results = []
|
||||
for item in response:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.com>
|
||||
#
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2016, Thomas Stringer <tomstr@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -207,7 +207,7 @@ class AzureRMFunctionApp(AzureRMModuleBase):
|
|||
)
|
||||
self.results['changed'] = True
|
||||
except CloudError as exc:
|
||||
self.fail('Failure while deleting web app: {}'.format(exc))
|
||||
self.fail('Failure while deleting web app: {0}'.format(exc))
|
||||
else:
|
||||
self.results['changed'] = False
|
||||
else:
|
||||
|
@ -235,7 +235,7 @@ class AzureRMFunctionApp(AzureRMModuleBase):
|
|||
).result()
|
||||
self.results['state'] = new_function_app.as_dict()
|
||||
except CloudError as exc:
|
||||
self.fail('Error creating or updating web app: {}'.format(exc))
|
||||
self.fail('Error creating or updating web app: {0}'.format(exc))
|
||||
|
||||
return self.results
|
||||
|
||||
|
@ -289,7 +289,7 @@ class AzureRMFunctionApp(AzureRMModuleBase):
|
|||
def storage_connection_string(self):
|
||||
"""Construct the storage account connection string"""
|
||||
|
||||
return 'DefaultEndpointsProtocol=https;AccountName={};AccountKey={}'.format(
|
||||
return 'DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}'.format(
|
||||
self.storage_account,
|
||||
self.storage_key
|
||||
)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.com>
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2016, Thomas Stringer <tomstr@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -782,7 +784,7 @@ class AzureRMLoadBalancer(AzureRMModuleBase):
|
|||
|
||||
def get_public_ip_address_instance(self, id):
|
||||
"""Get a reference to the public ip address resource"""
|
||||
self.log('Fetching public ip address {}'.format(id))
|
||||
self.log('Fetching public ip address {0}'.format(id))
|
||||
resource_id = format_resource_id(id, self.subscription_id, 'Microsoft.Network', 'publicIPAddresses', self.resource_group)
|
||||
return self.network_models.PublicIPAddress(id=resource_id)
|
||||
|
||||
|
@ -844,7 +846,7 @@ def default_compare(new, old, path):
|
|||
|
||||
def frontend_ip_configuration_id(subscription_id, resource_group_name, load_balancer_name, name):
|
||||
"""Generate the id for a frontend ip configuration"""
|
||||
return '/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}'.format(
|
||||
return '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/frontendIPConfigurations/{3}'.format(
|
||||
subscription_id,
|
||||
resource_group_name,
|
||||
load_balancer_name,
|
||||
|
@ -854,7 +856,7 @@ def frontend_ip_configuration_id(subscription_id, resource_group_name, load_bala
|
|||
|
||||
def backend_address_pool_id(subscription_id, resource_group_name, load_balancer_name, name):
|
||||
"""Generate the id for a backend address pool"""
|
||||
return '/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}'.format(
|
||||
return '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/backendAddressPools/{3}'.format(
|
||||
subscription_id,
|
||||
resource_group_name,
|
||||
load_balancer_name,
|
||||
|
@ -864,7 +866,7 @@ def backend_address_pool_id(subscription_id, resource_group_name, load_balancer_
|
|||
|
||||
def probe_id(subscription_id, resource_group_name, load_balancer_name, name):
|
||||
"""Generate the id for a probe"""
|
||||
return '/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/probes/{}'.format(
|
||||
return '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/probes/{3}'.format(
|
||||
subscription_id,
|
||||
resource_group_name,
|
||||
load_balancer_name,
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2016 Thomas Stringer, <tomstr@microsoft.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2016, Thomas Stringer <tomstr@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
@ -136,7 +123,7 @@ class AzureRMLoadBalancerFacts(AzureRMModuleBase):
|
|||
def get_item(self):
|
||||
"""Get a single load balancer"""
|
||||
|
||||
self.log('Get properties for {}'.format(self.name))
|
||||
self.log('Get properties for {0}'.format(self.name))
|
||||
|
||||
item = None
|
||||
result = []
|
||||
|
@ -160,12 +147,12 @@ class AzureRMLoadBalancerFacts(AzureRMModuleBase):
|
|||
try:
|
||||
response = self.network_client.load_balancers.list(self.resource_group)
|
||||
except AzureHttpError as exc:
|
||||
self.fail('Failed to list items in resource group {} - {}'.format(self.resource_group, str(exc)))
|
||||
self.fail('Failed to list items in resource group {0} - {1}'.format(self.resource_group, str(exc)))
|
||||
else:
|
||||
try:
|
||||
response = self.network_client.load_balancers.list_all()
|
||||
except AzureHttpError as exc:
|
||||
self.fail('Failed to list all items - {}'.format(str(exc)))
|
||||
self.fail('Failed to list all items - {0}'.format(str(exc)))
|
||||
|
||||
results = []
|
||||
for item in response:
|
||||
|
|
|
@ -1,21 +1,10 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2016 Bruno Medina Bolanos Cacho, <bruno.medina@microsoft.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible 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.
|
||||
#
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2016, Bruno Medina Bolanos Cacho <bruno.medina@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
@ -202,7 +191,7 @@ class AzureRMManagedDiskFacts(AzureRMModuleBase):
|
|||
try:
|
||||
response = self.compute_client.disks.list()
|
||||
except CloudError as exc:
|
||||
self.fail('Failed to list all items - {}'.format(str(exc)))
|
||||
self.fail('Failed to list all items - {0}'.format(str(exc)))
|
||||
|
||||
results = []
|
||||
for item in response:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (c) 2017 Sertac Ozercan, <seozerca@microsoft.com>
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2017, Sertac Ozercan <seozerca@microsoft.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -373,7 +373,7 @@ class AzureRMVirtualMachineScaleSetFacts(AzureRMModuleBase):
|
|||
def get_item(self):
|
||||
"""Get a single virtual machine scale set"""
|
||||
|
||||
self.log('Get properties for {}'.format(self.name))
|
||||
self.log('Get properties for {0}'.format(self.name))
|
||||
|
||||
item = None
|
||||
results = []
|
||||
|
@ -396,7 +396,7 @@ class AzureRMVirtualMachineScaleSetFacts(AzureRMModuleBase):
|
|||
try:
|
||||
response = self.compute_client.virtual_machine_scale_sets.list(self.resource_group)
|
||||
except CloudError as exc:
|
||||
self.fail('Failed to list all items - {}'.format(str(exc)))
|
||||
self.fail('Failed to list all items - {0}'.format(str(exc)))
|
||||
|
||||
results = []
|
||||
for item in response:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue