run-action should support a '--format=plain' that just passes the content out

Bug #1769062 reported by John A Meinel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Wishlist
Ian Booth

Bug Description

We have "juju run-action --wait" which is a nice way to invoke a command and grab the output without going through 'juju show-action-output'.
However, both of those commands only output yaml/json. Which means if you want to output something to be processed (certificate file, etc) you have to have some way to unwrap it.
While we might end up with multiple outputs from a single run command, that's probably still better to have a way to just flatten it.

Revision history for this message
John A Meinel (jameinel) wrote :

(noted during a demo where actually getting everything to work nicely had lots of copy & paste and | jq and other workarounds, when it should just be a single command.)

Revision history for this message
Tim McNamara (tim-clicks) wrote :

How do you recommend dealing with non-printable characters from the action?

Changed in juju:
assignee: nobody → Tim McNamara (tim-clicks)
Revision history for this message
Tim McNamara (tim-clicks) wrote :

Should --format=plain be disabled when multiple units are specified?

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1769062] Re: run-action should support a '--format=plain' that just passes the content out

Plain would indicate just outputing the content as a byte stream. (juju
run-action app create.zip --format=plain > foo.zip).
I would say if you have multiple units we could just concatenate them, or
disabling it would both be potential solutions.

On Mon, Jul 8, 2019 at 11:20 PM Tim McNamara <email address hidden>
wrote:

> Should --format=plain be disabled when multiple units are specified?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1769062
>
> Title:
> run-action should support a '--format=plain' that just passes the
> content out
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1769062/+subscriptions
>

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.7-beta1
assignee: Tim McNamara (tim-clicks) → Ian Booth (wallyworld)
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Revision history for this message
Tim McNamara (tim-clicks) wrote :
Revision history for this message
Tim McNamara (tim-clicks) wrote :

Ian, just double checking. Does --format=plain disable the YAML output? Looking at the QA steps, callers would still need to interpret YAML in order to access the action's output.

From the QA steps in the PR:

  $ juju call mariadb-k8s/0 hello who=world
  Running Operation 259d3f7b-f7ec-47a1-890c-51cc3c9d4ffb
  message: |-
    Hello world!

I would expect the output to look like this:

  $ juju call mariadb-k8s/0 hello who=world
  Hello world!

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

The plain text output is done for "juju call" rather than run-action as we are concentrating on a holistic actions UX change for Actions V2, which can be accessed by setting the client side "juju-v3" feature flag. The existing actions UX is being left untouched for compatibility reasons.

The plain output still does have a little necessary YAML because the actions can choose to set structured data for output. The plain output omits other more verbose metadata related YAML like timestamps etc.

Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.