Fix the log test so it uses the available context fields.

logging_context_format_string in log.py references fields
that don't exist in the common/context.py so we get errors
like:

---
File "/usr/lib64/python2.7/logging/__init__.py", line 467, in format
    s = self._fmt % record.__dict__
KeyError: 'project_id'
Logged from file test_log.py, line 42
---

We could change the defaults in log.py but that might cause
too much disruption to other projects.

Change-Id: Ic3f6039baccb522b5eb2462a87b792c226ca13ef
Completely remove cfg's disable_interspersed_args()

The use case for disable_interspersed_args() is that nova-manage
needs to be able to parse sub-commands. We now have a
add_cli_subparsers() method which better supports this use case.

Change-Id: I1fcd15889745fe4ddff0ac4bacf385004f9b61af
Merge "Completely remove cfg's disable_interspersed_args()"
Remove add_option() method

argparse just has an add_argument() method, so there's no reason for us
to keep add_option() around.

Change-Id: I6f4be089ceaf0fd8c4c99565af392b445916172e
Use stock argparse --version behaviour

optparse prints the version to stdout, argparse prints the version to
stderr.

There's no need to preserve the old optparse behaviour, let's just stick
with argparse behaviour.

Change-Id: Ie141c72112a63149d098afa9db55a95a309e79d7
Use stock argparse --usage behaviour

optparse would substitute the program name for %prog, but argparse
requires %(prog)s. Also, optparse would print 'Usage:' whereas
argparse prints 'usage:'.

Neither optparse behaviour that's worth retaining, let's just use
the default argparse behaviour.

Change-Id: Ied2acb37c366f1a45aed72b6b76f11e2de23828e
Use stock argparse behaviour for optional args

optparse would print "Options" but argparse prints "optional arguments".

The default argparse behaviour is fine, let's stick with that.

Change-Id: Ib53a2581af9d776e9a7c1cd90eebe89b70034e57
Add support for positional arguments

argparse makes it awkward to implement the current cfg API where we
simply return the leftover arguments to the caller.

Very few cfg users actually rely on this functionality and for those
cases it probably makes more sense for them to explicitly register
positional arguments or sub-parsers.

Add support for positional arguments via a 'required' Opt attribute:

  opt = StrOpt('foo', positional=True)
  conf.register_cli_opt(opt)
  conf(['bar'])
  conf.foo == 'bar'

Change-Id: Iea746d710237e1ea26c1ef4871643941d1df09bd
Remove ConfigCliParser class

This sub-class of ArgumentParser isn't really justified anymore.

Change-Id: I705224b6e18e4609a8e2deba283767233b0bd578
Merge "Fix the log test so it uses the available context fields."
Merge "Remove add_option() method"
Merge "Use stock argparse --version behaviour"
Merge "Use stock argparse --usage behaviour"
Merge "Use stock argparse behaviour for optional args"
Merge "Add support for positional arguments"
Merge "Remove ConfigCliParser class"
Fix minor coding style issue

Use the same style of exception handling used everywhere else.

Change-Id: I5436de1996f69ea6210f48c11ef231eb950ad21d
Don't reference argparse._StoreAction

This is a private implementation detail of argparse, so we don't want
to rely on it. Just sub-class Action instead.

Change-Id: Icfcc782cc334d1bc1d4940bec23af48ead692a9d