Comment 5 for bug 1846792

Revision history for this message
Ian Booth (wallyworld) wrote :

I'm having trouble reproducing this. Here's what I did. I have a charm with a sample action:

#!/bin/bash
action-set result-map.time-completed="$(date)"
action-set result-map.message="Hello $(action-get who)!"
action-log hello sailor
echo Goodbye cruel world
echo This message goes to stderr >&2
exit 3

You can see it writes to both stdout and stderr and also returns exit code != 0.

I run the action and get code, stdout, stderr in the YAML as expected:

$ juju run-action ubuntu-lite/0 hello who=world --format yaml --wait
unit-ubuntu-lite-0:
  id: "4"
  message: exit status 3
  results:
    Code: "3"
    Stderr: |
      This message goes to stderr
    Stdout: |
      Goodbye cruel world
    result-map:
      message: Hello world!
      time-completed: Thu Oct 10 07:20:34 UTC 2019
  status: failed
  timing:
    completed: 2019-10-10 07:20:35 +0000 UTC
    enqueued: 2019-10-10 07:20:32 +0000 UTC
    started: 2019-10-10 07:20:34 +0000 UTC
  unit: ubuntu-lite/0

Can you tell me the steps to reproduce with a simple charm?