commit 4a0ac4583b5e896d5b1af033ca2347f9fcc9daab
Author: Matt Mulsow <email address hidden>
Date: Mon Aug 8 21:26:01 2016 -0500
User-agent header shouldn't start with a space
If the application name, sys.argv[0], is an empty string, like when
called from the Ansible os_network module, then keystoneauth (with
the new requests 2.11.0) will raise an exception saying:
Invalid return character or leading space in header: User-Agent
This comes from keystoneauth trying to prepend the empty module
name to the default user agent, which leads to it sending a
User-Agent header that starts with a blank space. This was fine
until the new requests 2.11.0 was released which errors if header
values start with a leading space.
With this change, if sys.argv[0] is an empty string we'll just use
the DEFAULT_USER_AGENT and not try to prepend a calling module.
Closes-Bug: #1611426
Change-Id: I56d3e352dce7628add0479b3333a880700844ebc
Signed-off-by: Matt Mulsow <email address hidden>
Reviewed: https:/ /review. openstack. org/352673 /git.openstack. org/cgit/ openstack/ keystoneauth/ commit/ ?id=4a0ac4583b5 e896d5b1af033ca 2347f9fcc9daab
Committed: https:/
Submitter: Jenkins
Branch: master
commit 4a0ac4583b5e896 d5b1af033ca2347 f9fcc9daab
Author: Matt Mulsow <email address hidden>
Date: Mon Aug 8 21:26:01 2016 -0500
User-agent header shouldn't start with a space
If the application name, sys.argv[0], is an empty string, like when
called from the Ansible os_network module, then keystoneauth (with
the new requests 2.11.0) will raise an exception saying:
Invalid return character or leading space in header: User-Agent
This comes from keystoneauth trying to prepend the empty module
name to the default user agent, which leads to it sending a
User-Agent header that starts with a blank space. This was fine
until the new requests 2.11.0 was released which errors if header
values start with a leading space.
With this change, if sys.argv[0] is an empty string we'll just use
the DEFAULT_USER_AGENT and not try to prepend a calling module.
Closes-Bug: #1611426
Change-Id: I56d3e352dce762 8add0479b3333a8 80700844ebc
Signed-off-by: Matt Mulsow <email address hidden>