Bases: argparse.HelpFormatter
Convert the value in a dictionary entry to a dictionary.
From the kwargs dictionary, converts the value of the key_to_convert entry from a list of key-value pairs to a dictionary.
Parameters: |
|
---|---|
Returns: | kwargs, the (modified) dictionary |
Returns the Boolean represented by bool_str.
Returns the Boolean value for the argument named arg_name. The value is represented by the string bool_str. If the string is an invalid Boolean string: if strict is True, a CommandError exception is raised; otherwise the default value is returned.
Parameters: |
|
---|---|
Returns: | the Boolean value represented by bool_str or the default value if bool_str is invalid and strict is False |
Raises CommandError: | |
if bool_str is an invalid Boolean string |
Check for invalid fields.
Parameters: |
|
---|---|
Raises CommandError: | |
If invalid fields were specified by the user. |
Generate common filters for any list request.
Parameters: |
|
---|---|
Returns: | list of string filters. |
Generate ‘params’ dict that is common for every ‘list’ command.
Parameters: |
|
---|---|
Returns: | a dict with params to pass to the client method. |
Define a command in the subparsers collection.
Parameters: |
|
---|
Add do_ methods in a module and add as commands into a subparsers.
Read information from stdin.
Parameters: | info_desc – A string description of the desired information |
---|---|
Raises: | InvalidAttribute if there was a problem reading from stdin |
Returns: | the string that was read from stdin |
Attempts to read JSON argument from file or string.
Parameters: | json_arg – May be a file name containing the JSON, or a JSON string. |
---|---|
Returns: | A list or dictionary parsed from JSON. |
Raises: | InvalidAttribute if the argument cannot be parsed. |
Convert a list of key-value pairs to a dictionary.
Parameters: | key_value_pairs – a list of strings, each string is in the form <key>=<value> |
---|---|
Returns: | a dictionary, possibly empty |
Make the config drive file.
Parameters: | path – The directory containing the config drive files. |
---|---|
Returns: | A gzipped and base64 encoded configdrive string. |