major pep8 cleanup.

funneled scope of imports where possible
fixed #59
Added fstrings where possible
added logging both temporarily and in secondary places
This commit is contained in:
Nicholas St. Germain 2018-12-17 19:12:37 -06:00
parent 47f2f61082
commit 61fcf3b80c
13 changed files with 131 additions and 121 deletions

View file

@ -1,4 +1,4 @@
import logging
from logging import getLogger
from requests import Session, Request
from datetime import datetime, timezone
@ -13,12 +13,12 @@ class CiscoAPI(object):
# Create session to reduce server web thread load, and globally define pageSize for all requests
self.session = Session()
self.session.auth = (self.firewall.username, self.firewall.password)
self.logger = logging.getLogger()
self.logger = getLogger()
self.get_token()
def __repr__(self):
return "<ciscoasa-{}>".format(self.firewall.id)
return f"<ciscoasa-{self.firewall.id}>"
def get_token(self):
endpoint = '/api/tokenservices'