Skip to content

Commit

Permalink
Add debug messasge to aws_ec2 inventory plugin (ansible#43112)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebalaa authored and s-hertel committed Jul 23, 2018
1 parent d48415e commit 3c0a3a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ansible/plugins/inventory/aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
from ansible.module_utils.ec2 import ansible_dict_to_boto3_filter_list, boto3_tag_list_to_ansible_dict
from ansible.module_utils.ec2 import camel_dict_to_snake_dict
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable, to_safe_group_name
try:
from __main__ import display
except ImportError:
from ansible.utils.display import Display
display = Display()


try:
import boto3
Expand Down Expand Up @@ -502,6 +508,7 @@ def verify_file(self, path):
if super(InventoryModule, self).verify_file(path):
if path.endswith('.aws_ec2.yml') or path.endswith('.aws_ec2.yaml'):
return True
display.debug("aws_ec2 inventory filename must end with '*.aws_ec2.yml' or '*.aws_ec2.yaml'")
return False

def _get_query_options(self, config_data):
Expand Down

0 comments on commit 3c0a3a1

Please sign in to comment.