Hello,

This should fix https://fedorahosted.org/freeipa/ticket/3584, and as
requested in the ticket, this should also fix
https://fedorahosted.org/freeipa/ticket/2284

Thanks,

Gabe
From 3d4e7b60287f30e70455facb0035fa30df913c34 Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Fri, 22 May 2015 07:52:58 -0600
Subject: [PATCH] Fix ipa help command output errors

- Allow ipa help command to run when ipa-client-install is not configured
- Do not print traceback when pipe is broken

https://fedorahosted.org/freeipa/ticket/3584
https://fedorahosted.org/freeipa/ticket/2284
---
 ipalib/cli.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index fc6e2303919d4db724d97f839d9a1b71752dfc10..52529ea02c35a8119a5fb2397d7302d170e81526 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -799,7 +799,10 @@ class help(frontend.Local):
 
     def _writer(self, outfile):
         def writer(string=''):
-            print >> outfile, unicode(string)
+            try:
+                print >> outfile, unicode(string)
+            except IOError:
+                pass
         return writer
 
     def print_topics(self, outfile):
@@ -1333,7 +1336,7 @@ def run(api):
             api.register(klass)
         api.load_plugins()
         api.finalize()
-        if not 'config_loaded' in api.env:
+        if not 'config_loaded' in api.env and not 'help' in argv:
             raise NotConfiguredError()
         sys.exit(api.Backend.cli.run(argv))
     except KeyboardInterrupt:
-- 
1.8.3.1

-- 
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