DRY not being respected on zaqar/storage/utils.py

Bug #1584958 reported by Victoria Martinez de la Cruz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
Low
wanghao

Bug Description

The code merged to fix the py34 gate (avoiding _getattr_ reentring calls on py34) does not respect the DRY principle

    if dynamic:
        if not conf.safe_get(storage_group):
            conf.register_opts(storage_opts,
                               group=storage_group)
        if not conf.safe_get('drivers'):
            # NOTE(cpp-cabrera): parse general opts: 'drivers'
            driver_opts = utils.dict_to_conf({'message_store': storage_type})
            conf.register_opts(driver_opts, group=u'drivers')
    else:
        if storage_group not in conf:
            conf.register_opts(storage_opts,
                               group=storage_group)
        if 'drivers' not in conf:
            # NOTE(cpp-cabrera): parse general opts: 'drivers'
            driver_opts = utils.dict_to_conf({'message_store': storage_type})
            conf.register_opts(driver_opts, group=u'drivers')

We need to refactor this

Revision history for this message
wanghao (wanghao749) wrote :
Changed in zaqar:
assignee: nobody → wanghao (wanghao749)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zaqar (master)

Reviewed: https://review.openstack.org/320178
Committed: https://git.openstack.org/cgit/openstack/zaqar/commit/?id=437c2fe5671881189aba55391720d1a5351e1839
Submitter: Jenkins
Branch: master

commit 437c2fe5671881189aba55391720d1a5351e1839
Author: wanghao <email address hidden>
Date: Tue May 24 09:35:49 2016 +0800

    Refactor zaqar/storage/utils.py to respect DRY

    Refactor the code merged to fix the py34 issue,
    let it follow the DRY principle.

    Depends-on: I6da301dc4935ec8e4254d71ca93036f3d8db2bcf
    Change-Id: Iaa0768e795e172649787dc6d26722848b5d732ee
    Closes-Bug: #1584958

Changed in zaqar:
status: In Progress → Fix Released
Feilong Wang (flwang)
Changed in zaqar:
importance: Undecided → Low
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/zaqar 3.0.0.0b1

This issue was fixed in the openstack/zaqar 3.0.0.0b1 development milestone.

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.