forked from pool/python-napalm-asa
* Version bump * Implement token auth (#17) * Add built status and pypi version to README * PY3 compatibility for tests * Fix style and add optinal_args protection against falsy value * Add .travis.yaml * Support for rest-api agents that run on non-standard tcp port. (#14) * Clean up after replacing url2libe with requests * Removing pylama.ini * Replace urllib2 with requests - Add napalm-py23_compat.patch to fix missing py23_compat.py file (gh#napalm-automation-community/napalm-asa#35). - Add pylama.patch to fix two problems discovered by pylama (gh#napalm-automation-community/napalm-asa#36). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-napalm-asa?expand=0&rev=11
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
---
|
|
napalm_asa/asa.py | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
--- a/napalm_asa/asa.py
|
|
+++ b/napalm_asa/asa.py
|
|
@@ -62,7 +62,7 @@ class RespFetcherHttps:
|
|
try:
|
|
token_request = self.session.post(full_url, auth=(self.username, self.password),
|
|
data="", timeout=self.timeout, verify=False)
|
|
- if token_request.status_code is 204 and 'X-Auth-Token' in token_request.headers.keys():
|
|
+ if token_request.status_code == 204 and 'X-Auth-Token' in token_request.headers.keys():
|
|
self.token = token_request.headers['X-Auth-Token']
|
|
self.session.headers.update({'X-Auth-Token': token_request.headers['X-Auth-Token']})
|
|
return (True, None)
|
|
@@ -78,7 +78,7 @@ class RespFetcherHttps:
|
|
token_delete_request = self.session.delete(full_url,
|
|
auth=(self.username, self.password),
|
|
timeout=self.timeout, verify=False)
|
|
- if token_delete_request.status_code is 204:
|
|
+ if token_delete_request.status_code == 204:
|
|
self.session.headers.pop('X-Auth-Token', None)
|
|
return (True, None)
|
|
else:
|