Katello CLI specific option types

Option types allow to check and preprocess values of options. There are 6 option types that come with optparse by default.

Our KatelloOption adds 3 more on the top of them:

class katello.client.core.base.KatelloOption(*opts, **attrs)

Option types allow to check and preprocess values of options. There are 6 option types that come with optparse by default.

Our KatelloOption adds 3 more on the top of them:

bool

Parse a string and try to convert it to bool value.WW

allowed values:strings “true” and “false” at any case
return type:bool
arguments:none
# usage:
parser.add_option('--enable', dest='enable', type="bool")
list

Parse a string and try to tear it by a delimiter into a list of substrings.[[BR]] If no delimiter is found in the string the original value is returned as the only item of the list.

allowed values:

string (can contain the delimiter)

return type:

list of strings

arguments:
  • delimiter - string that delimits the values, default is ”,”
# usage:
parser.add_option('--package', dest='package', type="list", delimiter=",")
url

Parses an url string that starts with a given scheme (“http” and “https” is accepted by default). Throws an exception if the value is not a valid url.

allowed values:

string with valid url path

return type:

string

arguments:
  • schemes - list of strings, allowed schemes, default is [“http”, “https”]
# usage:
parser.add_option('--feed', dest='feed', type="url", schemes=['https'])

This Page