mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
3157eec28f
commit
585e0d1b8c
@ -237,6 +237,8 @@ def _create_topic(schema):
|
|||||||
topic['doc'] = ConcatenatedLazyText(schema['doc'])
|
topic['doc'] = ConcatenatedLazyText(schema['doc'])
|
||||||
if 'topic_topic' in schema:
|
if 'topic_topic' in schema:
|
||||||
topic['topic'] = str(schema['topic_topic'])
|
topic['topic'] = str(schema['topic_topic'])
|
||||||
|
else:
|
||||||
|
topic['topic'] = None
|
||||||
|
|
||||||
return topic
|
return topic
|
||||||
|
|
||||||
|
@ -248,9 +248,12 @@ class topic_(MetaObject):
|
|||||||
object.__setattr__(self, '_topic___topics', topics)
|
object.__setattr__(self, '_topic___topics', topics)
|
||||||
|
|
||||||
for command in self.api.Command():
|
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}
|
topic = topics[topic_name] = {'name': topic_name}
|
||||||
|
|
||||||
for package in self.api.packages:
|
for package in self.api.packages:
|
||||||
@ -267,11 +270,14 @@ class topic_(MetaObject):
|
|||||||
topic['doc'] = unicode(module.__doc__).strip()
|
topic['doc'] = unicode(module.__doc__).strip()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
topic_name = module.topic
|
topic_value = module.topic
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
topic_name = None
|
continue
|
||||||
else:
|
if topic_value is not None:
|
||||||
|
topic_name = unicode(topic_value)
|
||||||
topic['topic_topic'] = topic_name
|
topic['topic_topic'] = topic_name
|
||||||
|
else:
|
||||||
|
topic.pop('topic_topic', None)
|
||||||
|
|
||||||
return self.__topics
|
return self.__topics
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user