Bug 913695 - ovirt-engine-cli: suggest valid context for actions in error message [TEXT]
Summary: ovirt-engine-cli: suggest valid context for actions in error message [TEXT]
Keywords:
Status: CLOSED DUPLICATE of bug 867794
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.4.0
Assignee: Michael Pasternak
QA Contact: Haim
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-21 19:54 UTC by Oded Ramraz
Modified: 2016-02-10 16:53 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-07 09:53:57 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Oded Ramraz 2013-02-21 19:54:39 UTC
Description of problem:

Wrong error message when trying to detach storage domain without passing datacenter as a parameter:
error: action "deactivate" does not exist.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:


[RHEVM shell (connected)]# action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6 deactivate 


error: action "deactivate" does not exist.



[RHEVM shell (connected)]# action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6 deactivate --datacenter-identifier 5849b030-626e-47cb-ad90-3ce782d831b3

status-state: complete

Comment 1 Oded Ramraz 2013-02-21 20:01:30 UTC
Same for import template without specifying target storage domain: 

[RHEVM shell (connected)]# action template a946f165-2d27-4987-bbad-08ae0ac00aeb import_template 


error: action "import_template" does not exist

Comment 2 Michael Pasternak 2013-02-23 10:29:45 UTC
Oded,

both errors are correct, you trying to operate on:

/api/storagedomains/xxx
/api/templates/xxx

while actions deactivate/import, available only at:

/api/datacenters/aaa/storagedomains/xxx
/api/storagedomains/bbbtemplates/xxx

you could see this in action help:

1)

[oVirt shell (connected)]# help action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6

USAGE
  
  action <type> <id> <action> [parent identifiers] [command options]
  
DESCRIPTION
  
  Executes the an action on an object. This command requires the
  following arguments:
  
    * type        - The type to operate on
    * id          - The name or id identifying the object
    * action      - The action to take
  
AVAILABLE ACTIONS
  
  The following actions are available for the specified storagedomain object:
  


2) 

[oVirt shell (connected)]# help action template a946f165-2d27-4987-bbad-08ae0ac00aeb

USAGE
  
  action <type> <id> <action> [parent identifiers] [command options]
  
DESCRIPTION
  
  Executes the an action on an object. This command requires the
  following arguments:
  
    * type        - The type to operate on
    * id          - The name or id identifying the object
    * action      - The action to take
  
AVAILABLE ACTIONS
  
  The following actions are available for the specified template object:
  
    * export

- if you'd specify datacenter/storagedomain, you'd see actions you're trying to access,

- regardless of told above, i'll make error a bit more clear:

from => error: action XXX does not exist
to   => error: action XXX does not exist in this context [1]

[1] http://gerrit.ovirt.org/12345

Comment 3 Oded Ramraz 2013-02-24 07:08:19 UTC
I still think it is quite misleading , especially since the auto complete suggest this operation , Simon please advise:

[RHEVM shell (connected)]# action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6  
activate    datacenter  deactivate

[RHEVM shell (connected)]# action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6 deactivate 


error: action "deactivate" does not exist.


[RHEVM shell (connected)]# action storagedomain 7233a711-98e8-4c3c-bcfa-44c4bcc4f6c6 deactivate --datacenter-identifier 5849b030-626e-47cb-ad90-3ce782d831b3

status-state: complete

Comment 12 Michael Pasternak 2013-10-07 09:53:57 UTC

*** This bug has been marked as a duplicate of bug 867794 ***


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