Can't set headers when using the list resource api in Neutron Client

Bug #1731597 reported by Lyman Xu
This bug report is a duplicate of:  Bug #1720432: Request headers are thrown away. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
New
Undecided
Slawek Kaplonski

Bug Description

In neutronclient/v2_0/client.py, the api of listing resouce will call

def list(self, collection, path, retrieve_all=True, **params):
this list method will call

def _pagination(self, collection, path, **params):
this _pagination method will call

def get(self, action, body=None, headers=None, params=None):

We can see that we can set headers when using get(). But in list(),_pagination() they overlooked
the headers. In order to list the resource, I used the api of list(). But when I call the api of list, I can't set headers.

Best regards:-)

Changed in neutron:
assignee: nobody → Slawek Kaplonski (slaweq)
Revision history for this message
Lyman Xu (lyman-xu) wrote :

By the way, you need to pay attention to here:)
neutronclient/v2_0/client.py
line: 270
def do_request(self, method, action, body=None, headers=None, params=None):

will call line: 280
resp, replybody = self.httpclient.do_request(action, method, body=body)

ignore headers

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

I'm not sure but as I was checking it today it looks that any of neutronclient methods like list_networks or get_network and others similar don't support to pass additional headers to call.
IMO if You need to make such customized calls You should probably use keystoneauth1 and make REST calls with it.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This smells like duplicate of bug 1720432

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.