pep8
This commit is contained in:
parent
50c65ef5ac
commit
83ac14e7de
1 changed files with 1 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
from ipaddress import IPv4Address
|
||||||
from calendar import monthcalendar
|
from calendar import monthcalendar
|
||||||
from geoip2.database import Reader
|
from geoip2.database import Reader
|
||||||
from tarfile import open as taropen
|
from tarfile import open as taropen
|
||||||
|
@ -11,7 +12,6 @@ from json.decoder import JSONDecodeError
|
||||||
from os.path import abspath, join, basename, isdir
|
from os.path import abspath, join, basename, isdir
|
||||||
from urllib3.exceptions import InsecureRequestWarning
|
from urllib3.exceptions import InsecureRequestWarning
|
||||||
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
|
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
|
||||||
from ipaddress import IPv4Address
|
|
||||||
|
|
||||||
logger = getLogger()
|
logger = getLogger()
|
||||||
|
|
||||||
|
@ -110,10 +110,6 @@ def connection_handler(session, request, verify, as_is_reply=False):
|
||||||
return_json = get.json()
|
return_json = get.json()
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
logger.error('No JSON response. Response is: %s', get.text)
|
logger.error('No JSON response. Response is: %s', get.text)
|
||||||
# 204 No Content is for ASA only
|
|
||||||
elif get.status_code == 204:
|
|
||||||
if get.headers['X-Auth-Token']:
|
|
||||||
return get.headers['X-Auth-Token']
|
|
||||||
|
|
||||||
if air:
|
if air:
|
||||||
return get
|
return get
|
||||||
|
@ -126,7 +122,6 @@ def connection_handler(session, request, verify, as_is_reply=False):
|
||||||
except ConnectionError as e:
|
except ConnectionError as e:
|
||||||
logger.error('Cannot resolve the url/ip/port. Check connectivity. Error: %s', e)
|
logger.error('Cannot resolve the url/ip/port. Check connectivity. Error: %s', e)
|
||||||
|
|
||||||
|
|
||||||
return return_json
|
return return_json
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue