pep8 for merge + changes
This commit is contained in:
parent
21a559fccc
commit
0629c61a29
4 changed files with 7 additions and 6 deletions
|
@ -33,7 +33,7 @@ class GeoIPHandler(object):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
today = date.today()
|
today = date.today()
|
||||||
dbdate = None
|
|
||||||
try:
|
try:
|
||||||
dbdate = date.fromtimestamp(stat(self.dbfile).st_ctime)
|
dbdate = date.fromtimestamp(stat(self.dbfile).st_ctime)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
@ -55,7 +55,6 @@ class GeoIPHandler(object):
|
||||||
else:
|
else:
|
||||||
self.logger.debug('Geolite2 DB will update in %s days', abs(td.days))
|
self.logger.debug('Geolite2 DB will update in %s days', abs(td.days))
|
||||||
|
|
||||||
|
|
||||||
def download(self):
|
def download(self):
|
||||||
tar_dbfile = abspath(join(self.data_folder, 'GeoLite2-City.tar.gz'))
|
tar_dbfile = abspath(join(self.data_folder, 'GeoLite2-City.tar.gz'))
|
||||||
url = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz'
|
url = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz'
|
||||||
|
|
|
@ -66,7 +66,7 @@ class INIParser(object):
|
||||||
|
|
||||||
search = (r'(?:([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}|' # domain...
|
search = (r'(?:([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}|' # domain...
|
||||||
r'localhost|' # localhost...
|
r'localhost|' # localhost...
|
||||||
r'^[a-zA-Z0-9_-]*|' # hostname only. My soul dies a little every time this is used...
|
r'^[a-zA-Z0-9_-]*|' # hostname only. My soul dies a little every time this is used...
|
||||||
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
|
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
|
||||||
)
|
)
|
||||||
# Include search for port if it is needed.
|
# Include search for port if it is needed.
|
||||||
|
@ -80,7 +80,8 @@ class INIParser(object):
|
||||||
valid = match(regex, url_check) is not None
|
valid = match(regex, url_check) is not None
|
||||||
if not valid:
|
if not valid:
|
||||||
if inc_port:
|
if inc_port:
|
||||||
self.logger.error('%s is invalid in module [%s]! URL must host/IP and port if not 80 or 443. ie. localhost:8080',
|
self.logger.error('%s is invalid in module [%s]! URL must host/IP and '
|
||||||
|
'port if not 80 or 443. ie. localhost:8080',
|
||||||
url_check, module)
|
url_check, module)
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
|
@ -185,7 +186,7 @@ class INIParser(object):
|
||||||
|
|
||||||
server = OmbiServer(server_id, scheme + url, apikey, verify_ssl, request_type_counts,
|
server = OmbiServer(server_id, scheme + url, apikey, verify_ssl, request_type_counts,
|
||||||
request_type_run_seconds, request_total_counts,
|
request_type_run_seconds, request_total_counts,
|
||||||
request_total_run_seconds, issue_status_counts,
|
request_total_run_seconds, issue_status_counts,
|
||||||
issue_status_run_seconds)
|
issue_status_run_seconds)
|
||||||
|
|
||||||
if service == 'sickchill':
|
if service == 'sickchill':
|
||||||
|
|
|
@ -189,4 +189,4 @@ class OmbiAPI(object):
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
self.dbmanager.write_points(influx_payload)
|
self.dbmanager.write_points(influx_payload)
|
||||||
|
|
|
@ -108,6 +108,7 @@ class OmbiRequestCounts(NamedTuple):
|
||||||
approved: int = 0
|
approved: int = 0
|
||||||
available: int = 0
|
available: int = 0
|
||||||
|
|
||||||
|
|
||||||
class OmbiIssuesCounts(NamedTuple):
|
class OmbiIssuesCounts(NamedTuple):
|
||||||
pending: int = 0
|
pending: int = 0
|
||||||
inProgress: int = 0
|
inProgress: int = 0
|
||||||
|
|
Loading…
Reference in a new issue