Add version of the http agent to the user agent string

Change-Id: I61e85899be88788edc9091dd81f7cef3e8fa94a0
This commit is contained in:
David Moreau Simard 2018-09-20 13:56:00 -04:00
parent 96489515ac
commit 1e873cf9c9
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@
import json
import logging
import requests
import pbr.version
CLIENT_VERSION = pbr.version.VersionInfo(__name__).release_string()
class HttpClient(object):
@ -30,7 +33,7 @@ class HttpClient(object):
self.endpoint = endpoint
self.timeout = timeout
self.headers = {
'User-Agent': 'ara-http-client',
'User-Agent': 'ara-http-client_%s' % CLIENT_VERSION,
'Accept': 'application/json',
'Content-Type': 'application/json'
}