mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
Update access-logparser.py
Update access-logparser.py to account for when no matches in a file vs failing with error `AttributeError: 'NoneType' object has no attribute 'groupdict'`
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
__author__ = "Michael Ramsey"
|
__author__ = "Michael Ramsey"
|
||||||
__version__ = "0.1.1"
|
__version__ = "0.1.2"
|
||||||
__license__ = "GPL-3.0"
|
__license__ = "GPL-3.0"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -281,7 +281,12 @@ def main():
|
|||||||
if re.match("(.*)(/admin[a-zA-Z0-9_]*$)(.*)", line):
|
if re.match("(.*)(/admin[a-zA-Z0-9_]*$)(.*)", line):
|
||||||
prestashop_hit_count = prestashop_hit_count + 1
|
prestashop_hit_count = prestashop_hit_count + 1
|
||||||
m = pattern.match(line)
|
m = pattern.match(line)
|
||||||
|
if m is not None:
|
||||||
hit = m.groupdict()
|
hit = m.groupdict()
|
||||||
|
else:
|
||||||
|
# print("re.search() returned None")
|
||||||
|
continue
|
||||||
|
# hit = m.groupdict()
|
||||||
if ispage(hit):
|
if ispage(hit):
|
||||||
pages.append(pythonized(hit))
|
pages.append(pythonized(hit))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user