method signatures in db/sqlalchemy/api.py does not match its base method

Bug #1459662 reported by Accela Zhao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
High
Unassigned

Bug Description

I found in db/sqlalchemy/api.py that there are several methods whose signature does not match its base, for example, https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L140 (commit e5f78263)

```
def get_bay_list(self, context, filters=None, limit=None, marker=None,
                                   sort_key=None, sort_dir=None):
```

It missed `columns=None` from the base method signature at https://github.com/openstack/magnum/blob/master/magnum/db/api.py#L44

```
def get_bay_list(self, context, columns=None, filters=None, limit=None,
                                 marker=None, sort_key=None, sort_dir=None):
```

Other occurrences including

    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L310
    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L420
    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L525
    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L621
    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L725
    https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L826

Another problem is https://github.com/openstack/magnum/blob/master/magnum/db/sqlalchemy/api.py#L771. Looks like its parent class missed argument `context`.

Steven Dake (sdake)
Changed in magnum:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/186387
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=fd34adb8e7e0134363bc467306dc1952946e3f4c
Submitter: Jenkins
Branch: master

commit fd34adb8e7e0134363bc467306dc1952946e3f4c
Author: Accela Zhao <email address hidden>
Date: Mon Jun 1 18:56:09 2015 -0700

    Fix method signatures unmatching in db api

    There are a few method signatures in db/api.py who unmatches their
    children. For example `get_bay_list`

    ```
        def get_bay_list(self, context, columns=None, filters=None, limit=None,
                         marker=None, sort_key=None, sort_dir=None):
    ```

    The argument `columns` is never being respected or used in children or
    elsewhere. After collecting a few opinions we decided to remove the unused
    argument `column` from the base methods in db/api.py.

    Besides, there is another unmatch in db/api.py

    ```
    def get_service_by_name(self, bay_name):
    ```

    It misses argument `context` compared to its only child in
    db/sqlalchemy/api.py. This patch adds the argument `context`.

    Closes-Bug: #1459662
    Change-Id: If4f60661c9cd182d6bbe4539b3c594fb45744874

Changed in magnum:
status: Confirmed → Fix Committed
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-2
status: Fix Committed → Fix Released
Adrian Otto (aotto)
Changed in magnum:
milestone: mitaka-2 → mitaka-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.