mistralclient can't be imported from another openstack project

Bug #1325478 reported by Angus Salkeld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Angus Salkeld

Bug Description

mistralclient registers oslo logging config opts which conflict with other projects config opts.

  File "/home/angus/work/solum/solum/common/clients.py", line 17, in <module>
    from mistralclient.api import client as mistralclient
  File "/home/angus/work/python-mistralclient/mistralclient/api/client.py", line 21, in <module>
    from mistralclient.api import httpclient
  File "/home/angus/work/python-mistralclient/mistralclient/api/httpclient.py", line 19, in <module>
    from mistralclient.openstack.common import log as logging
  File "/home/angus/work/python-mistralclient/mistralclient/openstack/common/log.py", line 195, in <module>
    CONF.register_opts(log_opts)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 1547, in __inner
    result = f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 1687, in register_opts
    self.register_opt(opt, group, clear_cache=False)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 1551, in __inner
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 1676, in register_opt
    if _is_opt_registered(self._opts, opt):
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 516, in _is_opt_registered
    raise DuplicateOptError(opt.name)
DuplicateOptError: duplicate option: default_log_levels

I'd suggest not using oslo logging in the client, but base python logging if really needed.

Changed in mistral:
importance: Undecided → Medium
assignee: nobody → Angus Salkeld (asalkeld)
milestone: none → 0.1
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-mistralclient (master)

Reviewed: https://review.openstack.org/97162
Committed: https://git.openstack.org/cgit/stackforge/python-mistralclient/commit/?id=069f19e0b23f8cc0f45a58b963564c67a9a0ca4c
Submitter: Jenkins
Branch: master

commit 069f19e0b23f8cc0f45a58b963564c67a9a0ca4c
Author: Angus Salkeld <email address hidden>
Date: Mon Jun 2 19:48:57 2014 +1000

    Don't use oslo logging in the client

    Else this causes DuplicateOptError because both mistralclient
    and the project that imports mistralclient will have registered
    the logging options.

    Closes-bug: #1325478
    Change-Id: Id64fc61964d2f638be45bcf783275cb4d214aa2f

Changed in mistral:
status: Confirmed → Fix Committed
Changed in mistral:
milestone: 0.1 → 0.0.4
Changed in mistral:
status: Fix Committed → Fix Released
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.