Matt Mulsow
4a0ac4583b
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 <mamulsow@us.ibm.com>
keystoneauth
This package contains tools for authenticating to an OpenStack-based cloud. These tools include:
- Authentication plugins (password, token, and federation based)
- Discovery mechanisms to determine API version support
- A session that is used to maintain client settings across requests (based on the requests Python library)
Further information:
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/keystoneauth
- Source: http://git.openstack.org/cgit/openstack/keystoneauth
- Bugs: http://bugs.launchpad.net/keystoneauth
Description
Languages
Python
100%