Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-1259

Unable to see output from python script with shell:exec

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jboss-fuse-6.1
    • None
    • None
    • None
    • % %
    • Hide

      #!/bin/sh
      echo hi
      exec python /Users/sjavurek/Fuse/JBossFuse/jboss-fuse-6.0.0.redhat-024/simpleWithLogger.py
      cat yourlogfilename.txt

      Show
      #!/bin/sh echo hi exec python /Users/sjavurek/Fuse/JBossFuse/jboss-fuse-6.0.0.redhat-024/simpleWithLogger.py cat yourlogfilename.txt
    • Hide

      1. Try to execute simple.py from the console:

      shell:exec <patch>/simple.py

      No output.

      Show
      1. Try to execute simple.py from the console: shell:exec <patch>/simple.py No output.

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

      Attachments

        1. simple.py
          0.1 kB
        2. simpleWithLogger.py
          0.4 kB

        Activity

          People

            yfang@redhat.com Freeman(Yue) Fang
            rhn-support-sjavurek Susan Javurek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: