Bug 1027298

Summary: [RHEVM-CLI] mismatch between restore snapshot syntax and auto completion
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Barak Dagan <bdagan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, bazulay, iheim, juan.hernandez, myakove, oramraz, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Regression
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is28 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 1049022    

Description Barak Dagan 2013-11-06 13:57:10 UTC
Description of problem:
auto completion for restore snapshot is:
action snapshot --vm-identifier  restore

filling in the missing values, results "error: syntax error"

action snapshot --vm-identifier vmname restore snapid


The working syntax appears to be:
action snapshot snapid restore --vm-identifier vmname. In that syntax the action (restore) is not suggested after snapid, but "--vm-identifier  restore" again.

Version-Release number of selected component (if applicable):
is21

How reproducible:
100%

Steps to Reproduce:
1. see above
2.
3.

Actual results:
Getting the right syntax for restoring snapshot requires many tries

Expected results:
Auto completion guides for the correct syntax

Additional info:

Comment 1 Michael Pasternak 2013-11-06 14:39:37 UTC
ravi,

this is sounds like regression on one of latest auto-completion manipulations.

Comment 5 Itamar Heim 2013-12-13 18:22:52 UTC
michael - bug is flagged for 3.3.z, should probably be fixed?

Comment 6 Michael Pasternak 2013-12-15 07:39:15 UTC
(In reply to Itamar Heim from comment #5)
> michael - bug is flagged for 3.3.z, should probably be fixed?

currently sdk/cli are flat to 3.3 (no z yet), i think there is no point of
having Z for shell cause it's not like it fixes specific issue for given version
of api/sdk, it just addresses own problem, (also we can ship 3.3.0.12-1 to Z if
we really want), is this an issue?

Comment 8 Barak Dagan 2013-12-24 11:05:30 UTC
verified on is28.1:

sdk version    : 3.3.0.21.*final-.1
cli version    : 3.3.0.12.*final-.1
python version : 2.6.6.final.0


The CLI change the command from:

# action snapshot snapid --vm-identifier MyVm restore

to 

# action snapshot snapid restore --vm-identifier MyVm

This is the first time I see such a behaviour, the auto completion still complete in the wrong order, but the command is fixed during execution

Comment 9 Michael Pasternak 2013-12-24 11:15:57 UTC
(In reply to Barak Dagan from comment #8)
> verified on is28.1:
> 
> sdk version    : 3.3.0.21.*final-.1
> cli version    : 3.3.0.12.*final-.1
> python version : 2.6.6.final.0
> 
> 
> The CLI change the command from:
> 
> # action snapshot snapid --vm-identifier MyVm restore
> 
> to 
> 
> # action snapshot snapid restore --vm-identifier MyVm
> 
> This is the first time I see such a behaviour, the auto completion still
> complete in the wrong order, but the command is fixed during execution

this is an chicken & egg situation, you can't figure out what actions available
till you specify the context (vm in your case),

now cli is able to recognize such cases and address the syntax at runtime

Comment 11 Itamar Heim 2014-01-21 22:32:41 UTC
Closing - RHEV 3.3 Released

Comment 12 Itamar Heim 2014-01-21 22:32:48 UTC
Closing - RHEV 3.3 Released