Bug 1233639 - Autocompletion of "add" doesn't work for objects without a top level collection
Summary: Autocompletion of "add" doesn't work for objects without a top level collection
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-06-19 10:43 UTC by Juan Hernández
Modified: 2022-06-30 13:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 10:19:28 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-46856 0 None None None 2022-06-30 13:05:30 UTC

Description Juan Hernández 2015-06-19 10:43:08 UTC
The autocompletion of the options of the "add" command doesn't work for objects that don't have a corresponding top level collection. A notable example of this is the "qos" object. There isn't an top level "/qoss" collection in the system, instead it is a sub collection of the top level "/datacenters" collection.

The command to add a new "qos" should look like this:

  # add qos --parent-datacenter-name mydc --name myname --type mytype ...

But using the tab key for auto completion only displays the "parent-datacenter-*" options.

The root cause for this is that the "__add_resource_specific_options" method of the "AddCmdShell" class extracts the options from the broker class corresponding to the object, and it calculates the name of that class using a simple name mapping:

  whatever -> brokers.Whatever

This works fine for other object, for example for clusters:

  cluster -> brokers.Cluster

But for "qos" there isn't a "brokers.QoS" broker class, because there isn't such a collection.

To solve this problem the "__add_resource_specific_options" method of the "AddCmdShell" class needs to be changed so that in this particular case it retrieves the available options from the "brokers.DataCenterQos" class. In general it needs to take into account the given "--parent-*" options to decide what broker class to use.

Comment 1 Juan Hernández 2016-05-10 10:19:28 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.