summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-04-02 11:11:30 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-04-02 11:11:44 -0400
commita2e0b2b262b3b29834d3a90d660e5963abec73a7 (patch)
treef2cef6147f408bdedf622b8b658360443607a736
parent400dcb6687f2bcd92656444ac00e5d0a972c460d (diff)
downloadbcfg2-a2e0b2b262b3b29834d3a90d660e5963abec73a7.tar.gz
bcfg2-a2e0b2b262b3b29834d3a90d660e5963abec73a7.tar.bz2
bcfg2-a2e0b2b262b3b29834d3a90d660e5963abec73a7.zip
made bcfg2-info work with newer IPython
-rwxr-xr-xsrc/sbin/bcfg2-info9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index b68434e11..1e7ec4d49 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -165,8 +165,13 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core):
print("Dropping to python interpreter; press ^D to resume")
try:
import IPython
- shell = IPython.Shell.IPShell(argv=[], user_ns=locals())
- shell.mainloop()
+ if hasattr(IPython, "Shell"):
+ shell = IPython.Shell.IPShell(argv=[], user_ns=locals())
+ shell.mainloop()
+ elif hasattr(IPython, "embed"):
+ IPython.embed(user_ns=locals())
+ else:
+ raise ImportError
except ImportError:
sh.interact()