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

output: Add new output mode: cmd. #271

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

eiffel-fl
Copy link

Hi.

In this PR, I added a new output mode: cmd.
The main goal of this output mode is to be used when running a command in a VM or VMSS, so it display the output as if it is was printed locally instead of having the output stored inside JSON object which leads to loss of formatting:

# Without cmd
$ az vmss run-command invoke ... --command-id RunShellScript --instance-id 0 --scripts 'echo "foo\tbar\tquux\ncorge"' -o json
{
  "value": [
    {
      "code": "ProvisioningState/succeeded",
      "displayStatus": "Provisioning succeeded",
      "level": "Info",
      "message": "Enable succeeded: \n[stdout]\nfoo\tbar\tquux\ncorge\n\n[stderr]\n",
      "time": null
    }
  ]
}
# With cmd
$ az vmss run-command invoke ... --command-id RunShellScript --instance-id 0 --scripts 'echo "foo\tbar\tquux\ncorge"' -o cmd
foo     bar     quux
corge

If you have any comments to make this contribution better, feel free to share.

Best regards and thank you in advance.

This new output is thought to be used when executing a command in a VM/VMSS.
It permits to print the output of the command like if this was executed locally.

Signed-off-by: Francis Laniel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant