Bug 1219404 - Parameters nested two levels are incorrectly interpreted as top level options
Summary: Parameters nested two levels are incorrectly interpreted as top level options
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-engine-cli
Classification: oVirt
Component: General
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-07 09:10 UTC by Juan Hernández
Modified: 2022-06-30 13:06 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 10:18:41 UTC
oVirt Team: Infra
Embargoed:
sbonazzo: ovirt-4.1-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-46858 0 None None None 2022-06-30 13:06:15 UTC

Description Juan Hernández 2015-05-07 09:10:24 UTC
Currently the RESTAPI supports data structures that can be nested multiple times. For example, when creating a virtual machine the user can specify a set of "payloads" and each of these payloads can contain a set of "files":

  <vm>
    ...
    <payloads>
      <payload>
        <files>
          <file .../>
          <file .../>
          ...
        </files>
      </payload>
      <payload>
        <files>
          <file .../>
          <file .../>
          ...
        </files>
      </payload>
      ...
    </payloads>
    ...
  </vm>

This kind of multidimensional array is documented in the RSDL metadata file as two nested collections:

  vm.payloads.payload--COLLECTION: 
    payload.type: xs:string
    payload.volume_id: xs:string
    payload.files.file--COLLECTION: 
      file.name: xs:string
      file.content: xs:string

And this results on the following documentation in the generated Python SDK:

  [@param vm.payloads.payload: collection]
  {
    [@ivar payload.type: string]
    [@ivar payload.volume_id: string]
    [@ivar payload.files.file: collection]
    {
      [@param file.name: string]
      [@param file.content: string]
    }
  }

The CLI consumes this documentation, but it doesn't support this nesting. As a result the nested parameters are interpreted as regular top level parameters. In this case, for example, the CLI assumes that there are top level "name" and "content" parameters, which is wrong:

  $ ovirt-engine-shell
  # add vm --comm<TAB>  <-- This is incorrectly autocompletd as "comment"

These nested parameters should be supported correctly (see bug 1198677) or at least ignored.

Comment 1 Juan Hernández 2016-05-10 10:18:41 UTC
There aren't plans to update the CLI, so this won't be fixed.


Note You need to log in before you can comment on or make changes to this bug.