Public bug reported:

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.

** Affects: oslo-config (Ubuntu)
     Importance: Undecided
     Assignee: Baohua Yang (yangbaohua)
         Status: Confirmed

** Changed in: oslo-config (Ubuntu)
       Status: New => Confirmed

** Changed in: oslo-config (Ubuntu)
     Assignee: (unassigned) => Baohua Yang (yangbaohua)

** Changed in: oslo-config (Ubuntu)
       Status: Confirmed => Fix Committed

** Changed in: oslo-config (Ubuntu)
       Status: Fix Committed => Confirmed

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

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

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to