install: introduce updated knob constructor

Add new knob() knob constructor. Keep the old Knob() constructor for
backward compatibility with old code.

https://fedorahosted.org/freeipa/ticket/6392

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta 2016-10-26 16:05:44 +02:00
parent be0c1afa74
commit 9fd1981ae8

View File

@ -141,7 +141,7 @@ class KnobBase(PropertyBase):
return cls
def Knob(type_or_base, default=_missing, sensitive=_missing,
def knob(type_or_base, default=_missing, sensitive=_missing,
deprecated=_missing, description=_missing, cli_positional=_missing,
cli_name=_missing, cli_short_name=_missing, cli_aliases=_missing,
cli_metavar=_missing):
@ -175,6 +175,22 @@ def Knob(type_or_base, default=_missing, sensitive=_missing,
return util.InnerClassMeta('Knob', (type_or_base,), class_dict)
def Knob(type_or_base, default=_missing, sensitive=_missing,
deprecated=_missing, description=_missing, cli_positional=_missing,
cli_name=_missing, cli_short_name=_missing, cli_aliases=_missing,
cli_metavar=_missing):
return knob(type_or_base,
default=default,
sensitive=sensitive,
deprecated=deprecated,
description=description,
cli_positional=cli_positional,
cli_name=cli_name,
cli_short_name=cli_short_name,
cli_aliases=cli_aliases,
cli_metavar=cli_metavar)
class Configurable(six.with_metaclass(abc.ABCMeta, object)):
"""
Base class of all configurables.