[Bug 1363808] Re: register_cli_opts() does not work after register_opts()

Ben Nemec openstack at nemebean.com
Mon Apr 10 16:01:33 UTC 2017


Why was oslo-incubator added to this bug?  It doesn't exist anymore, and
I don't believe any of the relevant code here ever lived in incubator
anyway.

** Changed in: oslo-incubator
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to oslo-config in Ubuntu.
https://bugs.launchpad.net/bugs/1363808

Title:
  register_cli_opts() does not work after register_opts()

Status in oslo-incubator:
  Incomplete
Status in oslo-config package in Ubuntu:
  In Progress

Bug description:
  The following code will not register the common_opts as cli options,
  unless we put register_cli_opts() ahead of register_opts()

  ==================
  import sys
  from  oslo.config import cfg

  if __name__ == "__main__":
      common_opts = [ cfg.StrOpt('bind_host', default='0.0.0.0', help='IP address to listen on'), cfg.IntOpt('bind_port', default=9292, help='Port number to listen on') ]

      CONF = cfg.CONF
      CONF.register_opts(common_opts)
      CONF.register_cli_opts(common_opts)

      CONF(args=sys.argv[1:])
  ===================

  I think the usage order should not affect the registration.

To manage notifications about this bug go to:
https://bugs.launchpad.net/oslo-incubator/+bug/1363808/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list