Move initial JSON fetching into the expiration check function
It will avoid fetching it just to print the help Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
parent
9ff18d29a8
commit
d53d93c873
|
@ -15,6 +15,7 @@ import requests_cache
|
||||||
|
|
||||||
_log = logging.getLogger('nagiosplugin')
|
_log = logging.getLogger('nagiosplugin')
|
||||||
|
|
||||||
|
def expiration(domain):
|
||||||
list2dict = []
|
list2dict = []
|
||||||
|
|
||||||
session = requests_cache.CachedSession(
|
session = requests_cache.CachedSession(
|
||||||
|
@ -29,7 +30,6 @@ for list_of_list in req.json()['services']:
|
||||||
|
|
||||||
df = pandas.DataFrame(list2dict)
|
df = pandas.DataFrame(list2dict)
|
||||||
|
|
||||||
def expiration(domain):
|
|
||||||
domain = pyunycode.convert(domain)
|
domain = pyunycode.convert(domain)
|
||||||
tld = domain.split('.')[-1]
|
tld = domain.split('.')[-1]
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue