mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
PEP8 E712 fixes (#21916)
This commit is contained in:
parent
5d39056379
commit
305c88700d
34 changed files with 103 additions and 123 deletions
|
@ -1033,7 +1033,7 @@ class ElbManager(object):
|
|||
policy = []
|
||||
policy_type = 'LBCookieStickinessPolicyType'
|
||||
|
||||
if self.module.boolean(self.stickiness['enabled']) == True:
|
||||
if self.module.boolean(self.stickiness['enabled']) is True:
|
||||
|
||||
if 'expiration' not in self.stickiness:
|
||||
self.module.fail_json(msg='expiration must be set when type is loadbalancer')
|
||||
|
@ -1050,7 +1050,7 @@ class ElbManager(object):
|
|||
policy.append(self._policy_name(policy_attrs['type']))
|
||||
|
||||
self._set_stickiness_policy(elb_info, listeners_dict, policy, **policy_attrs)
|
||||
elif self.module.boolean(self.stickiness['enabled']) == False:
|
||||
elif self.module.boolean(self.stickiness['enabled']) is False:
|
||||
if len(elb_info.policies.lb_cookie_stickiness_policies):
|
||||
if elb_info.policies.lb_cookie_stickiness_policies[0].policy_name == self._policy_name(policy_type):
|
||||
self.changed = True
|
||||
|
@ -1062,7 +1062,7 @@ class ElbManager(object):
|
|||
elif self.stickiness['type'] == 'application':
|
||||
policy = []
|
||||
policy_type = 'AppCookieStickinessPolicyType'
|
||||
if self.module.boolean(self.stickiness['enabled']) == True:
|
||||
if self.module.boolean(self.stickiness['enabled']) is True:
|
||||
|
||||
if 'cookie' not in self.stickiness:
|
||||
self.module.fail_json(msg='cookie must be set when type is application')
|
||||
|
@ -1076,7 +1076,7 @@ class ElbManager(object):
|
|||
}
|
||||
policy.append(self._policy_name(policy_attrs['type']))
|
||||
self._set_stickiness_policy(elb_info, listeners_dict, policy, **policy_attrs)
|
||||
elif self.module.boolean(self.stickiness['enabled']) == False:
|
||||
elif self.module.boolean(self.stickiness['enabled']) is False:
|
||||
if len(elb_info.policies.app_cookie_stickiness_policies):
|
||||
if elb_info.policies.app_cookie_stickiness_policies[0].policy_name == self._policy_name(policy_type):
|
||||
self.changed = True
|
||||
|
|
|
@ -316,7 +316,7 @@ def create_eni(connection, vpc_id, module):
|
|||
eni = find_eni(connection, module)
|
||||
if eni is None:
|
||||
eni = connection.create_network_interface(subnet_id, private_ip_address, description, security_groups)
|
||||
if attached == True and instance_id is not None:
|
||||
if attached is True and instance_id is not None:
|
||||
try:
|
||||
eni.attach(instance_id, device_index)
|
||||
except BotoServerError:
|
||||
|
@ -399,14 +399,14 @@ def modify_eni(connection, vpc_id, module, eni):
|
|||
secondary_addresses_to_remove_count = current_secondary_address_count - secondary_private_ip_address_count
|
||||
connection.unassign_private_ip_addresses(network_interface_id=eni.id, private_ip_addresses=current_secondary_addresses[:secondary_addresses_to_remove_count], dry_run=False)
|
||||
|
||||
if attached == True:
|
||||
if attached is True:
|
||||
if eni.attachment and eni.attachment.instance_id != instance_id:
|
||||
detach_eni(eni, module)
|
||||
if eni.attachment is None:
|
||||
eni.attach(instance_id, device_index)
|
||||
wait_for_eni(eni, "attached")
|
||||
changed = True
|
||||
elif attached == False:
|
||||
elif attached is False:
|
||||
detach_eni(eni, module)
|
||||
|
||||
except BotoServerError as e:
|
||||
|
|
|
@ -448,7 +448,7 @@ def find_default_vpc_nacl(vpc_id, client, module):
|
|||
except botocore.exceptions.ClientError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
nacls = response['NetworkAcls']
|
||||
return [n['NetworkAclId'] for n in nacls if n['IsDefault'] == True]
|
||||
return [n['NetworkAclId'] for n in nacls if n['IsDefault'] is True]
|
||||
|
||||
|
||||
def find_subnet_ids_by_nacl_id(nacl_id, client, module):
|
||||
|
|
|
@ -1005,7 +1005,7 @@ def validate_parameters(required_vars, valid_vars, module):
|
|||
if k in valid_vars:
|
||||
params[v] = module.params[k]
|
||||
else:
|
||||
if module.params.get(k) == False:
|
||||
if module.params.get(k) is False:
|
||||
pass
|
||||
else:
|
||||
module.fail_json(msg="Parameter %s is not valid for %s command" % (k, command))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue