mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Simplify and correct comparisons with None.
This commit is contained in:
parent
2172201795
commit
fa8e653011
10 changed files with 16 additions and 16 deletions
|
@ -283,7 +283,7 @@ class Ec2Inventory(object):
|
|||
else:
|
||||
dest = getattr(instance, self.destination_variable)
|
||||
|
||||
if dest == None:
|
||||
if not dest:
|
||||
# Skip instances we cannot address (e.g. private VPC subnet)
|
||||
return
|
||||
|
||||
|
@ -303,7 +303,7 @@ class Ec2Inventory(object):
|
|||
self.push(self.inventory, self.to_safe('type_' + instance.instance_type), dest)
|
||||
|
||||
# Inventory: Group by key pair
|
||||
if instance.key_name != None:
|
||||
if instance.key_name:
|
||||
self.push(self.inventory, self.to_safe('key_' + instance.key_name), dest)
|
||||
|
||||
# Inventory: Group by security group
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue