CLI argument validation utility

Registered by Mark McLoughlin

In nova-manage and cinder-manage, we allow command arguments to be passed as optional or positional arguments.

e.g.

  $> nova-manage floating create 10.0.0.1/28
  $> nova-manage floating create --ip_range 10.0.0.1/28

are equivalent.

Once nova-manage has collected those arguments, it calls the appropriate command function with them as positional and keyword arguments. If the user forgets to supply a required argument, they merely get a TypeError with little useful information.

We should improve the usability of these commands with a utility function to check that the required arguments have been supplied and raise a useful exception if not.

Blueprint information

Status:
Complete
Approver:
Mark McLoughlin
Priority:
Medium
Drafter:
Mark McLoughlin
Direction:
Approved
Assignee:
Mark McLoughlin
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
Mark McLoughlin
Completed by
Mark McLoughlin

Related branches

Sprints

Whiteboard

This is based on jog0's idea in https://review.openstack.org/16342

Merged into oslo-incubator here: https://review.openstack.org/17043

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.