From 1e873cf9c95ade40e75538644c280ca460314c1b Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Thu, 20 Sep 2018 13:56:00 -0400 Subject: [PATCH] Add version of the http agent to the user agent string Change-Id: I61e85899be88788edc9091dd81f7cef3e8fa94a0 --- ara/clients/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ara/clients/http.py b/ara/clients/http.py index b21059e..c5c10e3 100644 --- a/ara/clients/http.py +++ b/ara/clients/http.py @@ -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' }