mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[cloud] If inventory file isn't able to be parsed by aws_ec2, raise an AnsibleParserError (#36387)
* If inventory file isn't able to be parsed by aws_ec2, return an empty dict instead of None * Raise an AnsibleParserError instead * remove extra lines * aws_ec2 inventory plugin - fix path matching logic
This commit is contained in:
parent
e3192fb3a4
commit
b39534201f
1 changed files with 2 additions and 3 deletions
|
@ -451,10 +451,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
:return the contents of the config file
|
||||
'''
|
||||
if super(InventoryModule, self).verify_file(path):
|
||||
if path.endswith('.aws_ec2.yml' or '.aws_ec2.yaml'):
|
||||
if path.endswith('.aws_ec2.yml') or path.endswith('.aws_ec2.yaml'):
|
||||
return self._read_config_data(path)
|
||||
else:
|
||||
raise AnsibleParserError("Not a ec2 inventory plugin configuration file")
|
||||
raise AnsibleParserError("Not a ec2 inventory plugin configuration file")
|
||||
|
||||
def _get_query_options(self, config_data):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue