diff options
author | Göktürk Yüksek <gokturk@gentoo.org> | 2017-01-01 23:54:10 -0500 |
---|---|---|
committer | Göktürk Yüksek <gokturk@gentoo.org> | 2017-01-01 23:54:10 -0500 |
commit | 4af894ac1b6b3290ef2aeed6cbfa9a90de495428 (patch) | |
tree | 04db8308e3ace54f05282feaea5718a4b045969b /client/gentoostats/utils.py | |
parent | server/static/about.html: fix the repo URI (diff) | |
download | gentoostats-4af894ac1b6b3290ef2aeed6cbfa9a90de495428.tar.gz gentoostats-4af894ac1b6b3290ef2aeed6cbfa9a90de495428.tar.bz2 gentoostats-4af894ac1b6b3290ef2aeed6cbfa9a90de495428.zip |
client/gentoostats-cli: add a command line option to specify the port
Remain consistent with gentoostats-send which has a ('-p', '--port')
command line option to specify the port for the remote server.
Diffstat (limited to 'client/gentoostats/utils.py')
-rw-r--r-- | client/gentoostats/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/gentoostats/utils.py b/client/gentoostats/utils.py index af8dab2..cc23033 100644 --- a/client/gentoostats/utils.py +++ b/client/gentoostats/utils.py @@ -8,14 +8,14 @@ except ImportError: # json headers for gentoostats-cli headers = {'Accept': 'application/json'} -def GET(server, url, headers, https=True): +def GET(server, port, url, headers, https=True): """ Get url from server using headers """ if https: - conn = httplib.HTTPSConnection(server) + conn = httplib.HTTPSConnection(server, port) else: - conn = httplib.HTTPConnection(server) + conn = httplib.HTTPConnection(server, port) try: conn.request('GET', url=url, headers=headers) data = conn.getresponse().read().decode("utf-8") |