schema: remove no_cli from command schema

Instead, support excluding commands from specified contexts and exclude
commands with NO_CLI set from the 'cli' context.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-20 12:56:28 +02:00
parent cbe73c6d28
commit 8cc8b6fb10
3 changed files with 15 additions and 20 deletions

View File

@@ -52,6 +52,16 @@ class BaseMetaObject(Object):
label=_("Documentation"),
flags={'no_search'},
),
Str(
'exclude*',
label=_("Exclude from"),
flags={'no_search'},
),
Str(
'include*',
label=_("Include in"),
flags={'no_search'},
),
)
def _get_obj(self, obj, **kwargs):
@@ -176,11 +186,6 @@ class command(metaobject):
label=_("Method name"),
flags={'no_search'},
),
Bool(
'no_cli?',
label=_("Exclude from CLI"),
flags={'no_search'},
),
)
def _iter_params(self, cmd):
@@ -210,7 +215,7 @@ class command(metaobject):
obj['attr_name'] = unicode(cmd.attr_name)
if cmd.NO_CLI:
obj['no_cli'] = True
obj['exclude'] = [u'cli']
return obj
@@ -468,16 +473,6 @@ class param(BaseParam):
label=_("Default from"),
flags={'no_search'},
),
Str(
'exclude*',
label=_("Exclude from"),
flags={'no_search'},
),
Str(
'include*',
label=_("Include in"),
flags={'no_search'},
),
Str(
'label?',
label=_("Label"),