Update some doc strings
This commit is contained in:
parent
5986959597
commit
27e99f2a84
1 changed files with 3 additions and 6 deletions
|
@ -55,14 +55,12 @@ class SoftLayerInventory(object):
|
||||||
print self.json_format_dict(self.inventory["_meta"]["hostvars"][self.args.host], True)
|
print self.json_format_dict(self.inventory["_meta"]["hostvars"][self.args.host], True)
|
||||||
|
|
||||||
def to_safe(self, word):
|
def to_safe(self, word):
|
||||||
''' Converts 'bad' characters in a string to underscores so they can be
|
'''Converts 'bad' characters in a string to underscores so they can be used as Ansible groups'''
|
||||||
used as Ansible groups '''
|
|
||||||
|
|
||||||
return re.sub("[^A-Za-z0-9\-\.]", "_", word)
|
return re.sub("[^A-Za-z0-9\-\.]", "_", word)
|
||||||
|
|
||||||
def push(self, my_dict, key, element):
|
def push(self, my_dict, key, element):
|
||||||
''' Pushed an element onto an array that may not have been defined in
|
'''Push an element onto an array that may not have been defined in the dict'''
|
||||||
the dict '''
|
|
||||||
|
|
||||||
if key in my_dict:
|
if key in my_dict:
|
||||||
my_dict[key].append(element);
|
my_dict[key].append(element);
|
||||||
|
@ -80,8 +78,7 @@ class SoftLayerInventory(object):
|
||||||
self.args = parser.parse_args()
|
self.args = parser.parse_args()
|
||||||
|
|
||||||
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 '''
|
|
||||||
|
|
||||||
if pretty:
|
if pretty:
|
||||||
return json.dumps(data, sort_keys=True, indent=2)
|
return json.dumps(data, sort_keys=True, indent=2)
|
||||||
|
|
Loading…
Reference in a new issue