Bases: 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.
kwargs – a dictionary
key_to_convert – the key (in kwargs), whose value is expected to be a list of key=value strings. This value will be converted to a dictionary.
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.
arg_name – The name of the argument
bool_str – The string representing a Boolean value
strict – Used if the string is invalid. If True, raises an exception. If False, returns the default value.
default – The default value to return if the string is invalid and not strict
the Boolean value represented by bool_str or the default value if bool_str is invalid and strict is False
CommandError – if bool_str is an invalid Boolean string
Check for invalid fields.
fields – A list of fields specified by the user.
valid_fields – A list of valid fields.
CommandError – If invalid fields were specified by the user.
Generate common filters for any list request.
marker – entity ID from which to start returning entities.
limit – maximum number of entities to return.
sort_key – field to use for sorting.
sort_dir – direction of sorting: ‘asc’ or ‘desc’.
fields – a list with a specified set of fields of the resource to be returned.
detail – Boolean, True to return detailed information. This parameter can be used for resources which accept ‘detail’ as a URL parameter.
list of string filters.
Generate ‘params’ dict that is common for every ‘list’ command.
args – arguments from command line.
fields – possible fields for sorting.
field_labels – possible field labels for sorting.
a dict with params to pass to the client method.
Convert the list-type properties to comma-separated strings
data – the input dict object.
props – the properties whose values will be converted. Default to None to convert all list-type properties of the input.
the result dict instance.
Define a command in the subparsers collection.
subparsers – subparsers collection where the command will go
command – command name
callback – function that will be used to process the command
Add do_ methods in a module and add as commands into a subparsers.
Read information from stdin.
info_desc – A string description of the desired information
InvalidAttribute if there was a problem reading from stdin
the string that was read from stdin
Check if the binary data is JSON and parse it if so.
Only supports dictionaries.
Read a JSON argument from stdin, file or string.
json_arg – May be a file name containing the JSON, a JSON string, or ‘-’ indicating that the argument should be read from standard input.
info_desc – A string description of the desired information
A list or dictionary parsed from JSON.
InvalidAttribute if the argument cannot be parsed.
Attempts to read JSON argument from file or string.
json_arg – May be a file name containing the YAML or JSON, or a JSON string.
A list or dictionary parsed from JSON.
InvalidAttribute if the argument cannot be parsed.
Convert a list of key-value pairs to a dictionary.
key_value_pairs – a list of strings, each string is in the form <key>=<value>
a dictionary, possibly empty
Make the config drive file.
path – The directory containing the config drive files.
A gzipped and base64 encoded configdrive string.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.