Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
%
-
-
Description
I have a customer who is trying to execute a python script from karaf. Using the she'll:exec command, this appears to work just fine:
shell:exec python /Users/sjavurek/Fuse/JBossFuse/jboss-fuse-6.0.0.redhat-024/simple.py
In the log I can see it run properly:
14:12:51,178 | INFO | l Console Thread | ExecuteAction | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Process exited w/status: 0
14:20:30,144 | INFO | l Console Thread | ExecuteAction | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Executing: [python, /Users/sjavurek/Fuse/JBossFuse/jboss-fuse-6.0.0.redhat-024/simple.py]
14:21:10,283 | INFO | l Console Thread | ExecuteAction | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Process exited w/status: 0
I'm not getting the output to the console though. Perhaps related to https://issues.apache.org/jira/browse/KARAF-2378?
I've been able to add a logger to my script (simpleWithLogger.py), however, this works intermittently.
shell:source for a shell script seems to consistently work. I tried running the python script from there but to no avail. The best I can do is dump the file, i.e:
#!/bin/sh
echo hi
exec python /Users/sjavurek/Fuse/JBossFuse/jboss-fuse-6.0.0.redhat-024/simpleWithLogger.py
cat yourlogfilename.txt
This seems rather hacky ...