Port nova.flags to cfg
Port nova.flags to cfg

This modifies nova.flags to emulate gflags using the new cfg module
instead of optparse.

One side effect of this is that nova now has a --config-file argument
which allows a .ini style config file to be used instead of a gflags
style file.

Downstream packagers may choose to switch to using this new config
file by default, or stick with the gflags style file for now. We may,
in time, choose to deprecate --flagfile.

Obviously, this change is just a stepping stone towards having Nova use
the cfg API throughout the codebase. Next steps might include:

  - Adding a DEFINE_opt() function and starting to convert all the
    option definitions to the cfg.Opt schema types

  - Passing a ConfigOpts instance around rather than referring to the
    global flags.FLAGS variable

  - Adding a default .ini style config file with the default values
    commented out and an explanation of each option. This could
    potentially be autogenerated from the option schemas in the code.

  - Making use of option groups to organize options

  - In time, deprecating --flagfile

  - In time, also deprecating most of the options as CLI options and
    only allowing them to be set via config files

There are two hacks in the current code where we directly access the
OptionParser instance which is technically just a private implementation
detail of the ConfigOpts class:

  - We need to use optparse's disable_interspersed_args(). I think it's
    needed for nova-manage

  - We still need the gross hack for handling unknown CLI args. We
    should either make sure they are registered at startup, or just wait
    until we make them unavailable via the CLI before removing the hack.
    This would also allow us to remove the gross hack to allow CLI opts
    to be registered after the CLI args have been parsed.

One final note - the cfg module doesn't have support yet for multistr
opts where values are spread across the command line and config files.
This isn't a regression as it still works fine with the CLI and
--flagfile, and it should be straightforward to support later.

Change-Id: I173b99ffd645b8ac5babd68e5c2ed521b98ec2ca

n0ano/gantt,n0ano/gantt