Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nmaludy opened this issue Jul 12, 2019 · 4 comments · Fixed by #4741
Closed

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

nmaludy opened this issue Jul 12, 2019 · 4 comments · Fixed by #4741
Labels

Comments

@nmaludy
Copy link
Member

nmaludy commented Jul 12, 2019

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
@nmaludy
Copy link
Member Author

nmaludy commented Jul 12, 2019

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.

@nmaludy
Copy link
Member Author

nmaludy commented Jul 12, 2019

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

@stale
Copy link

stale bot commented Oct 10, 2019

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.

@stale stale bot added the stale label Oct 10, 2019
@nmaludy
Copy link
Member Author

nmaludy commented Oct 10, 2019

PR is still open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants