Commit 27e99f2a by AJ Bourg

Update some doc strings

parent 59869595
...@@ -55,14 +55,12 @@ class SoftLayerInventory(object): ...@@ -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): ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment