Skip to content

st2 execution get doesn't print action.ref for non-workflow actions #4739

Closed

Description

@nmaludy

SUMMARY

When running st2 execution get the action isn't printed so the user is confused as to what type of action it is.

STACKSTORM VERSION

$ st2 --version
st2 3.2dev (e682072), on Python 2.7.5
OS, environment, install method
RHEL 7.6
Puppet-st2

Steps to reproduce the problem

This breaks for st2 run and st2 execution get probably a few more

$ st2 run core.local cmd=date
.
id: 5d289e5f9387ef2ebde9513e
status: succeeded
parameters: 
  cmd: date
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Fri Jul 12 10:51:11 EDT 2019
  succeeded: true
$ st2 execution get 5d289e5f9387ef2ebde9513e
id: 5d289e5f9387ef2ebde9513e
status: succeeded (0s elapsed)
parameters: 
  cmd: date
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Fri Jul 12 10:51:11 EDT 2019
  succeeded: true

Expected Results

When running/getting a workflow action the action ref is displayed, i would expect the same for non-workflow actions.

$ st2 execution get 5d289e5f9387ef2ebde9513e
id: 5d289e5f9387ef2ebde9513e
action.ref: core.local
status: succeeded (0s elapsed)
parameters: 
  cmd: date
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Fri Jul 12 10:51:11 EDT 2019
  succeeded: true

Activity

  1. nmaludy commented on Jul 12, 2019

    @nmaludy
    MemberAuthor

    Debugging this, i found that the displayed attributes are hard coded in the --attr argument definition: https://github.com/StackStorm/st2/blob/master/st2client/st2client/commands/action.py#L299

    Instead of using the display_attributes property of each command: https://github.com/StackStorm/st2/blob/master/st2client/st2client/commands/action.py#L242-L243

    I'm thinking the proper fix is to change the default for the --attr argument to be default=self.display_attributes.

  2. nmaludy commented on Jul 12, 2019

    @nmaludy
    MemberAuthor

    Found out too that this is how the st2 execution list command sets up its defaults for the --attr param. Guessing this was missed when doing some refactoring.

    https://github.com/StackStorm/st2/blob/master/st2client/st2client/commands/action.py#L1106

  3. added a commit that references this issue on Jul 12, 2019
    7f8a651
  4. stale commented on Oct 10, 2019

    @stale

    Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.

  5. nmaludy commented on Oct 10, 2019

    @nmaludy
    MemberAuthor

    PR is still open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions