diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-06-07 12:51:06 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-06-09 09:11:28 +0200 |
commit | 585e0d1b8c22cd20c207903047dc17f7318c50c4 (patch) | |
tree | cc399279a94e36b505b5ad6d3adbab5b597a9397 | |
parent | 3157eec28ff35e3c407a9552d6b59bef9891b555 (diff) | |
download | freeipa-585e0d1b8c22cd20c207903047dc17f7318c50c4.tar.gz freeipa-585e0d1b8c22cd20c207903047dc17f7318c50c4.tar.xz freeipa-585e0d1b8c22cd20c207903047dc17f7318c50c4.zip |
schema: fix topic command output
Return topic names as text instead of binary blob.
This fixes ipa help topic display.
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
-rw-r--r-- | ipaclient/remote_plugins/schema.py | 2 | ||||
-rw-r--r-- | ipaserver/plugins/schema.py | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py index 7d1b1e4fa..c84994dec 100644 --- a/ipaclient/remote_plugins/schema.py +++ b/ipaclient/remote_plugins/schema.py @@ -237,6 +237,8 @@ def _create_topic(schema): topic['doc'] = ConcatenatedLazyText(schema['doc']) if 'topic_topic' in schema: topic['topic'] = str(schema['topic_topic']) + else: + topic['topic'] = None return topic diff --git a/ipaserver/plugins/schema.py b/ipaserver/plugins/schema.py index d66943c2e..80c485dfd 100644 --- a/ipaserver/plugins/schema.py +++ b/ipaserver/plugins/schema.py @@ -248,9 +248,12 @@ class topic_(MetaObject): object.__setattr__(self, '_topic___topics', topics) for command in self.api.Command(): - topic_name = command.topic + topic_value = command.topic + if topic_value is None: + continue + topic_name = unicode(topic_value) - while topic_name is not None and topic_name not in topics: + while topic_name not in topics: topic = topics[topic_name] = {'name': topic_name} for package in self.api.packages: @@ -267,11 +270,14 @@ class topic_(MetaObject): topic['doc'] = unicode(module.__doc__).strip() try: - topic_name = module.topic + topic_value = module.topic except AttributeError: - topic_name = None - else: + continue + if topic_value is not None: + topic_name = unicode(topic_value) topic['topic_topic'] = topic_name + else: + topic.pop('topic_topic', None) return self.__topics |