1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Update some doc strings

This commit is contained in:
AJ Bourg 2014-05-26 16:36:32 -06:00
parent 5986959597
commit 27e99f2a84

View file

@ -55,14 +55,12 @@ class SoftLayerInventory(object):
print self.json_format_dict(self.inventory["_meta"]["hostvars"][self.args.host], True)
def to_safe(self, word):
''' Converts 'bad' characters in a string to underscores so they can be
used as Ansible groups '''
'''Converts 'bad' characters in a string to underscores so they can be used as Ansible groups'''
return re.sub("[^A-Za-z0-9\-\.]", "_", word)
def push(self, my_dict, key, element):
''' Pushed an element onto an array that may not have been defined in
the dict '''
'''Push an element onto an array that may not have been defined in the dict'''
if key in my_dict:
my_dict[key].append(element);
@ -80,8 +78,7 @@ class SoftLayerInventory(object):
self.args = parser.parse_args()
def json_format_dict(self, data, pretty=False):
''' Converts a dict to a JSON object and dumps it as a formatted
string '''
'''Converts a dict to a JSON object and dumps it as a formatted string'''
if pretty:
return json.dumps(data, sort_keys=True, indent=2)