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

CLI json/yaml output not wrapping single disk(...) by array #5445

Closed
7 tasks
vholer opened this issue Jul 1, 2021 · 1 comment
Closed
7 tasks

CLI json/yaml output not wrapping single disk(...) by array #5445

vholer opened this issue Jul 1, 2021 · 1 comment

Comments

@vholer
Copy link
Contributor

vholer commented Jul 1, 2021

Description
As part of implementation in #4950 it was validated, that XSD is respected and entitites, which are expected to appear as multiple instances, must be represented as an array even if there is none or a single one. E.g., DISK, NIC, ...

A manual validation on 6.0.3 / CentOS 8 revels it's not true anymore:

Current output with single disk:

# onevm show 53 --json
...
      "DISK": {
        "ALLOW_ORPHANS": "YES",
        "CLONE": "YES",
...

and with hot-attached second disk:

# onevm show 53 --json
...
      "DISK": [
        {
          "ALLOW_ORPHANS": "YES",
...

**Test must be extended to check these cases!!!**

To Reproduce
CLI show something with --json or --yaml and with single DISK/NIC.

Expected behavior
For none disk, output is like a (or missing)

"DISK": [ ],

For one disk, output is:

"DISK": [ { ... } ],

Details

  • Affected Component: CLI
  • Version: 6.0.3

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@xorel
Copy link
Member

xorel commented Aug 23, 2021

for 6.0 + master
fix
tests

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

No branches or pull requests

4 participants