os-brick should use oslo_log for logging

Bug #1443681 reported by Tomoki Sekiyama
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
High
Tomoki Sekiyama
os-brick
Fix Released
High
Unassigned

Bug Description

Currently, the following code will fails by exception "oslo_config.cfg.DuplicateOptError: duplicate option: default_log_levels".
When "from os_brick.initiator import connector" is commented out, the exception doesn't occur.
This is because os-brick is not using oslo_log but using oslo-incubator's logging.py.
This should by replaced with oslo_log.

*Code to reproduce the bug:

 from os_brick.initiator import connector
 from oslo_log import log as logging
 from oslo_config import cfg

 CONF = cfg.CONF
 logging.register_options(CONF)

*Result:

 Traceback (most recent call last):
   File "test.py", line 6, in <module>
     logging.register_options(CONF)
   File "/usr/lib/python2.7/site-packages/oslo_log/log.py", line 202, in register_options
     conf.register_opts(_options.log_opts)
   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1794, in __inner
     result = f(self, *args, **kwargs)
   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1951, in register_opts
     self.register_opt(opt, group, clear_cache=False)
   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1798, in __inner
     return f(self, *args, **kwargs)
   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1940, in register_opt
     if _is_opt_registered(self._opts, opt):
   File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 573, in _is_opt_registered
     raise DuplicateOptError(opt.name)
 oslo_config.cfg.DuplicateOptError: duplicate option: default_log_levels

Jay Bryant (jsbryant)
Changed in cinder:
importance: Undecided → High
status: New → Confirmed
Changed in cinder:
assignee: nobody → Vilobh Meshram (vilobhmm)
Revision history for this message
Tomoki Sekiyama (tsekiyama) wrote :

A patch to fix this bug is proposed:
  https://review.openstack.org/#/c/173106/

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
Vilobh Meshram (vilobhmm) wrote :

Looks like tsekiyama alreadys tarted working on this. Came to know about this when I proposed the fix https://review.openstack.org/#/c/173500/ so I abandoned it. Moving it back to tsekiyama.

Changed in cinder:
assignee: Vilobh Meshram (vilobhmm) → nobody
assignee: nobody → Tomoki Sekiyama (tsekiyama)
Revision history for this message
Michal Dulko (michal-dulko-f) wrote :

These bugs should be reported for os-brick as Launchpad project is already there. ;)

Revision history for this message
Walt Boring (walter-boring) wrote :

This bug has already been addressed in os-brick. You can check the latest code in

https://github.com/openstack/os-brick

Changed in os-brick:
status: New → Fix Released
importance: Undecided → High
Changed in cinder:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.