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

Chuck Short chuck.short at canonical.com
Mon Apr 10 14:41:48 UTC 2017


** Also affects: oslo-incubator
   Importance: Undecided
       Status: New

-- 
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:
  New
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