wants to use the opts from same group for default value of another opt to be registered in same group

Asked by One Convergence CI

hi all,
we want to register a opt in a group using oslo.config.cfg.register_opt(rabbit_hosts, group=opt). The rabbit_hosts is a list object which is made from rabbit_host & rabbit_port opt from SERVERS group. i had tried as follows:

1) opt = [cfg.ListOpt('rabbit_hosts',
                default=['$rabbit_host:$rabbit_port'],
                help='RabbitMQ HA cluster host:port pairs')
           ]
  cfg.CONF.register_opts(opt, group=SERVERS)
2) opt = [cfg.ListOpt('rabbit_hosts',
                default=['$SERVERS.rabbit_host:$SERVERS.rabbit_port'],
                help='RabbitMQ HA cluster host:port pairs')
           ]
  cfg.CONF.register_opts(opt, group=SERVERS)

but it is giving NOSuchOPT error all the time.
thanks for your response in advance

Question information

Language:
English Edit question
Status:
Solved
For:
oslo-incubator Edit question
Assignee:
No assignee Edit question
Solved by:
One Convergence CI
Solved:
Last query:
Last reply:
Revision history for this message
One Convergence CI (oc-neutron-test) said :
#1

opt = [cfg.ListOpt('rabbit_hosts',
                default=['%s:%s' % (cfg.CONF.SERVERS.rabbit_host, cfg.CONF.SERVERS.rabbit_port)],
                help='RabbitMQ HA cluster host:port pairs')
           ]
  cfg.CONF.register_opts(opt, group=SERVERS)