(refactor) common.sql.migration.find_migrate_repo never used with an argument.

Bug #1273336 reported by Ilya Pekelny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
Ilya Pekelny

Bug Description

If we look attentively to a `find_migrate_repo` usage we will see:
    $ grep -r "find_migrate_repo" keystone

    keystone/common/sql/migration.py: repo_path = find_migrate_repo()
    keystone/common/sql/migration.py: repo_path = find_migrate_repo()
    keystone/common/sql/migration.py: repo_path = find_migrate_repo()

The function never been used with an argument. What does it mean? This mean that the only line is needed in this function https://github.com/openstack/keystone/blob/master/keystone/common/sql/migration.py#L87. And at this point the function is redundant in the current state. Must be refactored.

Ilya Pekelny (i159)
Changed in keystone:
assignee: nobody → Ilya Pekelny (i159)
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Wishlist
status: New → Triaged
summary: - common.sql.migration.find_migrate_repo never used with an argument.
+ (refactor) common.sql.migration.find_migrate_repo never used with an
+ argument.
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: Triaged → In Progress
Ilya Pekelny (i159)
Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
Dolph Mathews (dolph) wrote :

("Fix Committed" is intended to reflect that the patch has been merged)

Changed in keystone:
status: Fix Committed → In Progress
Revision history for this message
Ilya Pekelny (i159) wrote :

Thanks! I'm sorry.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/69593
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=7dcd6f03b88ac4c00e9c50e98f5318eac05527fd
Submitter: Jenkins
Branch: master

commit 7dcd6f03b88ac4c00e9c50e98f5318eac05527fd
Author: Ilya Pekelny <email address hidden>
Date: Mon Jan 27 19:40:54 2014 +0200

    Correct `find_migrate_repo` usage

    The `find_migrate_repo` function was never used with an argument although the
    function interface presupposes an optional argument named
    `package`.

    $ grep -r "find_migrate_repo" keystone

        keystone/common/sql/migration.py: repo_path = find_migrate_repo()
        keystone/common/sql/migration.py: repo_path = find_migrate_repo()
        keystone/common/sql/migration.py: repo_path = find_migrate_repo()

    The wrong function usage makes the function redundant (only one
    string is needed there, all others are never executed) and forces redundant
    code lines in other modules.
    Database migration functions must take an extension module object and handle
    a migration repository path with `find_migrate_repo` function.

    ::db_sync: [version, [package]]
    ::db_version: [package]
    ::db_version_control: [version, [package]]

    `find_migrate_repo` raises an error when the migrate repository path doesn't
    exist. The error should be handled to prevent further unexpected behaviour.

    Closes-Bug: #1273336
    Change-Id: Id62a1859a7e72139d25dfe91d29805660b4b7394

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