Pass hostname to auth token request

Related to T56381
This commit is contained in:
2018-08-15 13:06:45 +02:00
parent 18a99a437a
commit fbcc6dc511
2 changed files with 9 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ import urllib.parse
import requests
from . import timeouts, exceptions
from . import timeouts, exceptions, sockutil
log = logging.getLogger(__name__)
@@ -137,7 +137,10 @@ class BenchmarkClient:
self._start_http_server()
params = urllib.parse.urlencode({'auth_callback': self.auth_http_server.auth_callback_url})
params = urllib.parse.urlencode({
'auth_callback': self.auth_http_server.auth_callback_url,
'hostname': sockutil.hostname(),
})
url = f"{self.url_generate_token}?{params}"
if not webbrowser.open_new_tab(url):

View File

@@ -56,3 +56,7 @@ def find_free_port(start_address):
port_nr += 1
return hostname, port_nr
def hostname() -> str:
return socket.gethostname()