Disabling interspersed args in cfg
Nova currently relies on cfg being implemented with optparse because it uses optparse's disable_
The use case for this is if you do:
$> nova-manage --verbose create --project foo --user bar
you want invoking ConfigOpts() to return ['create', '--project', 'foo', '--user', 'bar'] as the "extra" args rather than aborting when it doesn't recognize the --project arg.
This is a reasonable use case for cfg to support and it should just have {disable,
If we switch to argparse, we'll do something like this:
parser.
...
parser.
...
ns = parser.
extra_args = ns.extra_args
i.e. we will need an 'extra_args' multi-value positional argument in any case and we'll just pass nargs=REMAINDER if we want trailing options to be included in the extra args
Blueprint information
- Status:
- Complete
- Approver:
- Mark McLoughlin
- Priority:
- Medium
- Drafter:
- Mark McLoughlin
- Direction:
- Approved
- Assignee:
- Mark McLoughlin
- Definition:
- Approved
- Series goal:
- Accepted for essex
- Implementation:
- Implemented
- Milestone target:
- 2012.1
- Started by
- Mark McLoughlin
- Completed by
- Mark McLoughlin
Related branches
Related bugs
Sprints
Whiteboard
Addressed by: https:/
Add support to cfg for disabling interspersed args