From 90200c3637c91c89fc93d5a8951bd8731bf60437 Mon Sep 17 00:00:00 2001 From: mtoshi Date: Fri, 13 Oct 2017 19:12:16 +0900 Subject: [PATCH 1/2] Change url path method with urljoin --- airwaveapiclient/airwaveapiclient.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/airwaveapiclient/airwaveapiclient.py b/airwaveapiclient/airwaveapiclient.py index 2f9090d..82eb604 100644 --- a/airwaveapiclient/airwaveapiclient.py +++ b/airwaveapiclient/airwaveapiclient.py @@ -3,10 +3,13 @@ """airwaveapiclient.""" -import os from collections import OrderedDict import xmltodict import requests +try: + from urllib.parse import urljoin +except ImportError: + from urlparse import urljoin class AirWaveAPIClient(object): @@ -62,7 +65,7 @@ def login(self): """ requests.packages.urllib3.disable_warnings() self.session = requests.Session() - url = os.path.join(self.url, 'LOGIN') + url = self.api_path('LOGIN') destination = '/' next_action = '' params = {'credential_0': self.username, @@ -96,7 +99,7 @@ def api_path(self, path): URL string 'https://xxx.xxx.xxx.xxx/xxxxxx' """ - return os.path.join(self.url, path) + return urljoin(self.url, path) def amp_stats(self): """Get AMP stats. From 17f23e35f253be0b5d5e8076b1df77dd01157744 Mon Sep 17 00:00:00 2001 From: mtoshi Date: Fri, 13 Oct 2017 19:18:47 +0900 Subject: [PATCH 2/2] Change version and docs history --- docs/source/conf.py | 4 ++-- docs/source/history.rst | 4 ++++ setup.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 36baf89..a290c2d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -65,9 +65,9 @@ # built documents. # # The short X.Y version. -version = '0.1.8' +version = '0.1.9' # The full version, including alpha/beta/rc tags. -release = '0.1.8' +release = '0.1.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/history.rst b/docs/source/history.rst index 2634f4f..a3fe8f2 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -1,6 +1,10 @@ History ============ +0.1.9 (2017-10-13) +------------------ +* Change method to generate URL path. + 0.1.8 (2017-06-30) ------------------ * Added AMP stats and folder list methods. diff --git a/setup.py b/setup.py index eceb924..5fe4b47 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ def run_tests(self): setup( name="airwaveapiclient", - version="0.1.8", + version="0.1.9", description='Aruba Networks AirWave API Client.', long_description=README, author='Toshikatsu Murakoshi',