mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-09 18:51:29 -07:00
Cleans some unnecessary white spaces in ec2.py dynamic inventory plugin
This commit is contained in:
parent
77a2ad0e8c
commit
e8c3e3d645
1 changed files with 2 additions and 4 deletions
|
@ -420,7 +420,7 @@ class Ec2Inventory(object):
|
||||||
self.add_rds_instance(instance, region)
|
self.add_rds_instance(instance, region)
|
||||||
except boto.exception.BotoServerError as e:
|
except boto.exception.BotoServerError as e:
|
||||||
error = e.reason
|
error = e.reason
|
||||||
|
|
||||||
if e.error_code == 'AuthFailure':
|
if e.error_code == 'AuthFailure':
|
||||||
error = self.get_auth_error_message()
|
error = self.get_auth_error_message()
|
||||||
if not e.reason == "Forbidden":
|
if not e.reason == "Forbidden":
|
||||||
|
@ -513,7 +513,7 @@ class Ec2Inventory(object):
|
||||||
errors.append(" - No Boto config found at any expected location '%s'" % ', '.join(boto_paths))
|
errors.append(" - No Boto config found at any expected location '%s'" % ', '.join(boto_paths))
|
||||||
|
|
||||||
return '\n'.join(errors)
|
return '\n'.join(errors)
|
||||||
|
|
||||||
def fail_with_error(self, err_msg):
|
def fail_with_error(self, err_msg):
|
||||||
'''log an error to std err for ansible-playbook to consume and exit'''
|
'''log an error to std err for ansible-playbook to consume and exit'''
|
||||||
sys.stderr.write(err_msg)
|
sys.stderr.write(err_msg)
|
||||||
|
@ -1025,7 +1025,6 @@ class Ec2Inventory(object):
|
||||||
|
|
||||||
return list(name_list)
|
return list(name_list)
|
||||||
|
|
||||||
|
|
||||||
def get_host_info_dict_from_instance(self, instance):
|
def get_host_info_dict_from_instance(self, instance):
|
||||||
instance_vars = {}
|
instance_vars = {}
|
||||||
for key in vars(instance):
|
for key in vars(instance):
|
||||||
|
@ -1225,7 +1224,6 @@ class Ec2Inventory(object):
|
||||||
|
|
||||||
return re.sub("[^A-Za-z0-9\_]", "_", word)
|
return re.sub("[^A-Za-z0-9\_]", "_", word)
|
||||||
|
|
||||||
|
|
||||||
def json_format_dict(self, data, pretty=False):
|
def json_format_dict(self, data, pretty=False):
|
||||||
''' Converts a dict to a JSON object and dumps it as a formatted
|
''' Converts a dict to a JSON object and dumps it as a formatted
|
||||||
string '''
|
string '''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue