redundant code in glance.tests.unit.utils:FakeDB.reset

Bug #1264204 reported by ZhiQiang Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
ZhiQiang Fan

Bug Description

glance.tests.unit.utils:FakeDB uses glance.db.simple.api

FakeDB implements reset with:

    @staticmethod
    def reset():
        simple_db.DATA = {
            'images': {},
            'members': [],
            'tags': {},
            'locations': [],
            'tasks': {},
            'task_info': {}
        }

while api already has:

def reset():
    global DATA
    DATA = {
        'images': {},
        'members': [],
        'tags': {},
        'locations': [],
        'tasks': {},
        'task_info': {}
    }

the redundant code in glance.tests.unit.utils:FakeDB.reset should be replaced with simple_db.reset()

ZhiQiang Fan (aji-zqfan)
Changed in glance:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
tags: added: low-hanging-fruit unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/64087

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

Reviewed: https://review.openstack.org/64087
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=2bebf1090156da5a773df723026c16bc40d8a138
Submitter: Jenkins
Branch: master

commit 2bebf1090156da5a773df723026c16bc40d8a138
Author: ZhiQiang Fan <email address hidden>
Date: Thu Dec 26 12:10:05 2013 +0800

    Refactor tests.unit.utils:FakeDB.reset

    glance.tests.unit.utils:FakeDB uses glance.db.simple.api which has
    already implemented reset() functionality, the redundant code in
    FakeDB should be removed.

    Change-Id: I140e932e9cc531900cee503e20d3549549b13d27
    Closes-Bug: #1264204

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-2 → 2014.1
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.