unmatch attribute while calling get_grant_resource

Bug #1924956 reported by LiangLu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
In Progress
Medium
Yi Feng

Bug Description

while calling get_grant_resource() from _scale_grant in conductor,
an unmatch parameter happened:

2021-04-15 17:14:05.531 TRACE oslo_messaging.rpc.server ^[[01;35m^[[00mTypeError: get_grant_resource() got an unexpected keyword argument 'plugin'

This error is caused by calling get_grant_resource() with parameter 'plugin'

https://opendev.org/openstack/tacker/src/branch/master/tacker/conductor/conductor_server.py#L1202

however in openstack.py, get_grant_resource() does not have this parameter:

https://opendev.org/openstack/tacker/src/branch/master/tacker/vnfm/infra_drivers/openstack/openstack.py#L1803

Solution: add 'plugin=None' to get_grant_resource()

Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Changed in tacker:
assignee: nobody → Hiromu Asahina (h-asahina)
Revision history for this message
Yasufumi Ogawa (yasufum) wrote :

Hi,

Looking at openstack infra_driver quickly, there is some common style to have an arg `plugin` and caller gives `self` to it even if it's not used actually. So, why don't you follow the convention at once instead of using default value `None` exceptionally?

Revision history for this message
Hiromu Asahina (h-asahina) wrote :

Thank you for your suggestion.
As you pointed out, there is some common style we can follow.

There are two reasons I decided to delete this arg instead of following such style:
i) It's not used (as you pointed out);
ii) The infra drivers inherit an abstract class `VnfScaleAbstractDriver` that defines `get_grant_resource` method without `plugin` arg.

I guess, in general, abstract classes shouldn't be changed frequently.
Would you give me your thoughts?

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/795016

Changed in tacker:
status: New → In Progress
Revision history for this message
Yi Feng (fengyi765) wrote :

To Hiromu Asahina:
Sorry, I don't know this bug has assigned to you.
In my branch https://review.opendev.org/c/openstack/tacker/+/795016, I have fixed this bug just delete the `plugin` arg in `conductor_server` to make my modification for get_grant_resource_scale_out can work correctly.
If you have other solutions, I can withdraw the modification or you can comment on my patch and let me modify it.

Revision history for this message
Hiromu Asahina (h-asahina) wrote :

Thank you for letting me know.
I commented on your patch.

Yasufumi Ogawa (yasufum)
Changed in tacker:
assignee: Hiromu Asahina (h-asahina) → Yi Feng (fengyi765)
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.