Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1233639

Summary: Autocompletion of "add" doesn't work for objects without a top level collection
Product: [oVirt] ovirt-engine-cli Reporter: Juan Hernández <juan.hernandez>
Component: GeneralAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, gklein, lsurette, oourfali, rbalakri, srevivo, ykaul
Target Milestone: ---Flags: sbonazzo: ovirt-4.1-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 10:19:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.