Why the neutron's attr_info doesn't update?

asked 2020-09-01 22:13:56 -0500

corey gravatar image

I want to customize the value timeout client and timeout server in haproxy.conf (which is 50000 by default), and I tried to add a parameter in neutron-lbaas so that I can post request from Heat template with a customized timeout value.

I add a parameter in neutron-lbaas and restart neutron-lbaasv2-agent.service, it failed with the following message:

BadRequest: resources.corey_loadbalancer: Unrecognized attribute(s) 'client_timeout'

Here is the one part of my code I modified:
Add a param 'client_timeout' in RESOURCE_ATTRIBUTE_MAP (neutron_lbaas/extensions/loadbalancerv2.py)

RESOURCE_ATTRIBUTE_MAP = { 'loadbalancers': { ...... 'client_timeout': {'allow_post': True, 'allow_put': True, 'validate': {'type:range': [1000, 3600000]}, 'default': lb_const.DEFAULT_CLIENT_TIMEOUT, 'convert_to': converters.convert_to_int, 'is_visible': True} }

When I trace the code I found that the request will go to neutron/api/v2.0/base.py, it will do verify_attributes in this part, the post body and the attr_info are different, so it will detect an extra_keys then raise an exception Unrecognized attribute(s):

Request body:
{u'loadbalancer': {u'vip_subnet_id': u'd271a0f1-bcc8-4ae9-893f-db9a7ec51910', u'admin_state_up': True, u'description': u'corey-loadbalancer', u'name': u'Corey-LoadBalancer', u'client_timeout': 65000} }

I can't find the attribute 'client_timeout' from attr_info:
{'description': {'default': '', 'is_visible': True, 'validate': {'type:string': 255}, 'allow_put': True, 'allow_post': True}......... ......'operating_status': {'is_visible': True, 'allow_put': False, 'allow_post': False}}

I stuck at this point, I don't know why attr_info doesn't contain my new attribute 'client_timeout', I already tried to restart all neutron-related service, but doesn't work at all,

Why the neutron's attr_info doesn't update?
How can I do to update the attr_info?
Is there any miss-configuration in the neutron-lbaas? I wonder.

Any help is appreciated!

edit retag flag offensive close merge delete