This is the Misc common library. |
ICS Library for System Configuration
list of weak references to the object (if defined)
Parse SSH Public Key
Parameters: | sshpub (string) – SSH public key contents |
---|
Get augeas output via recursive solution (low-level)
Parameters: | path (string) – augeas string |
---|
Convert augeas output as dict format (low-level)
Parameters: | data (generator) – augeas output data |
---|---|
Return type: | dict |
Returns: | a dictionary contains augeas output data |
Update hostname
Parameters: | hostname (string) – hostname need to udpate |
---|
Decorator for retrying function if exception occurs
Parameters: |
|
---|
list of weak references to the object (if defined)
alias of Exception
A helper function that prints out the error message recieved in the response_data and raises an error when there is an error.
Clean Empty Items in the Dictionary: None, {}, [], “”
recursively merges dict’s. not just simple a[‘key’] = b[‘key’], if both a and bhave a key who’s value is a dict then dict_merge is called on both values and the result stored in the returned dictionary.
Execute Shell Commands
(not support for pipe in shell command)
Parameters: | cmd (string) – shell commands |
---|---|
Return type: | tuple |
Returns: | a tuple containing (exitstatus, stdout, stderr) |
Execute Shell Commands
Parameters: | cmd (string) – shell commands |
---|---|
Return type: | string or bool |
Returns: | False or error reason |
Fetch used parameters from the whole configuration
Filter the resource with specified filter on JSON data
Parameters: | |
---|---|
Return type: | list |
Returns: | a list containing all the names for filtered resources |
Refine the format of tags under AWS tag syntax
Parameters: |
---|
Get the complete data paths under the path to search
Parameters: | search_path (string) – describes the folder path to search |
---|
Get the complete data path matched with the specified name
Parameters: |
---|
Get the complete data paths under all the folder paths to search
Parameters: | search_paths (list) – a list of folder paths to search |
---|
Return the complete folder path used when searching for data files.
Parameters: | search_paths (list) – a list of folder paths to search |
---|
Returns the instance userdata as a string by default.
If the timeout is specified, the connection to the specified url will time out after the specified number of seconds.
Parameters: | |
---|---|
Return type: | string |
Returns: | a string containing user data |
Initialize the proper service with botocore
Convert the key name of JSON data: from camel case to a “pythonic” name.
Parameters: | fp_json (object) – opened file object |
---|
Convert the key name of JSON data: from camel case to a “pythonic” name.
Parameters: | dict_json (dict) – JSON data |
---|
Convert the key name of JSON data: from camel case to a “pythonic” name.
Parameters: | str_json (string) – JSON data |
---|
A helper function that universally calls any command by taking in the service, name of the command, and any additional parameters required in the call.