« Previous | Next » 

Revision c1ce76bb

IDc1ce76bb45105d83a4f83e990cb38d2d94fadec0

Added by Iustin Pop almost 13 years ago

Fix handling of 'vcpus' in instance list

Currently running “gnt-instance list -o+vcpus” fails with a cryptic message:
Unhandled Ganeti error: vcpus

This is due to multiple issues:
- in some corner cases cmdlib.py raises an errors.ParameterError but
this is not handled by cli.py
- LUQueryInstances declares ‘vcpu’ as a supported field, but doesn't handle
it, so instead of failing with unknown parameter, e.g.:
Failure: prerequisites not met for this operation:
Unknown output fields selected: vcpuscd
it raises the ParameteError message

This patch:
- adds handling of 'vcpus' to LUQueryInstances
- adds handling of the ParameterError exception to cli.py
- changes the 'else: raise errors.ParameterError' in the field handling of
LUQueryInstance to an assert, since it's a programmer error if we reached
this step

With this, a future unhandled parameter will show:
gnt-instance list -o+vcpus
Unhandled protocol error while talking to the master daemon:
Caught exception: Declared but unhandled parameter 'vcpus'

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences