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 committed 2016-06-20 16:39:12 +02:00
1 parent cbe73c6d28
commit 8cc8b6fb10
3 files changed
+15 -20

No files matched your search

+2 -2
View File
@@ -293,8 +293,8 @@ def _create_command(schema):
command['obj_name'] = str(schema['obj_class'])
if 'attr_name' in schema:
command['attr_name'] = str(schema['attr_name'])
if 'no_cli' in schema:
command['NO_CLI'] = schema['no_cli']
if 'exclude' in schema and u'cli' in schema['exclude']:
command['NO_CLI'] = True
command['takes_args'] = tuple(
_create_param(s) for s in schema['params']
if s.get('positional', s.get('required', True)))