URL: https://github.com/freeipa/freeipa/pull/701
Author: neffs
 Title: #701: ipa help doesn't always work
Action: opened

PR body:
"""
`ipa help` will not work when calling it when no schema is cached.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/701/head:pr701
git checkout pr701
From a806f26fca0eb1529dc1a1de0b5e5deac6409588 Mon Sep 17 00:00:00 2001
From: David Kreitschmann <da...@kreitschmann.de>
Date: Fri, 7 Apr 2017 18:22:25 +0200
Subject: [PATCH] Store help in Schema before writing to disk

Signed-off-by: David Kreitschmann <da...@kreitschmann.de>
---
 ipaclient/remote_plugins/schema.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py
index 3ecd608..9b6668d 100644
--- a/ipaclient/remote_plugins/schema.py
+++ b/ipaclient/remote_plugins/schema.py
@@ -383,6 +383,7 @@ def __init__(self, client, fingerprint=None):
 
         if fingerprint is None:
             fingerprint, ttl = self._fetch(client, ignore_cache=read_failed)
+            self._help = self._generate_help(self._dict)
             try:
                 self._write_schema(fingerprint)
             except Exception as e:
@@ -498,7 +499,7 @@ def _write_schema_data(self, fileobj):
 
             schema.writestr(
                 '_help',
-                json.dumps(self._generate_help(self._dict)).encode('utf-8')
+                json.dumps(self._help).encode('utf-8')
             )
 
     def read_namespace_member(self, namespace, member):
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to