From 585e0d1b8c22cd20c207903047dc17f7318c50c4 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Tue, 7 Jun 2016 12:51:06 +0200 Subject: 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 --- ipaclient/remote_plugins/schema.py | 2 ++ 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 -- cgit