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

Baohua Yang baohyang at cn.ibm.com
Tue Apr 11 02:25:41 UTC 2017


invalid after lots of change.

** Changed in: oslo-config (Ubuntu)
       Status: In Progress => Invalid

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

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