Juan Hernandez has submitted this change and it was merged.
Change subject: cli: Always add -identifier and -name options
......................................................................
cli: Always add -identifier and -name options
Currently the "*-identifier" and "*-name" options are added to the
autocompletion list only if the name of the option isn't already a valid
option. For example, when adding a VM the "cluster" is already a valid
option because the cluster can be specified as an attribute:
POST /vms
<vm>
<name>myvm</name>
<cluster id="..."/>
...
</vm>
But the the cluster identifier may also be needed as a parent
identifier, for example when adding a VM to an affinity group:
POST /clusters/{cluster:id}/affinitygroups/{affinitygroup:id}/vms
<vm>
<name>myvm</name>
</vm>
In this context the command will need to include the
"cluster-identifier" option:
# add vm \
--affinitygroup-identifier {affinitygroup:id} \
--cluster-identifier {cluster:id} \
--name myvm
But the "cluster-identifier" option isn't provided in autocompletion
because it is hidden by the "cluster-id" option. To avoid this issue
this patch changes the CLI so that the "*-identifier" and "*-name"
options will be added in autocompletion even if the object names is
already a valid option.
Change-Id: I8247ddff518850cd2751d98a33a55456ff401e6b
Bug-Url:
https://bugzilla.redhat.com/1206875
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M src/ovirtcli/utils/autocompletionhelper.py
1 file changed, 16 insertions(+), 17 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
--
To view, visit
https://gerrit.ovirt.org/39617
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8247ddff518850cd2751d98a33a55456ff401e6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org