From 24b13ca8042fd9e3beef23eea3fe561d98860eb0 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Mon, 4 Sep 2023 12:54:49 +0200 Subject: [PATCH] Upd requitements, add global_protect bool --- lib/query.py | 6 +++++- lib/version.py | 2 +- requirements.txt | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/query.py b/lib/query.py index 4b33e1e..11f26af 100644 --- a/lib/query.py +++ b/lib/query.py @@ -14,11 +14,15 @@ async def query( if not address: address = asset.name assert asset_config, 'missing credentials' + + global_protect = check_config.get('global_protect', False) + port = ':4443' if global_protect and ':' not in address else '' + api_key = asset_config['secret'] headers = { 'X-PAN-KEY': api_key, } - url = f'https://{address}/api/?type=op&cmd={cmd}' + url = f'https://{address}{port}/api/?type=op&cmd={cmd}' async with aiohttp.ClientSession() as session: async with session.post(url, headers=headers, ssl=False) as resp: diff --git a/lib/version.py b/lib/version.py index aa3cebd..a529aaa 100644 --- a/lib/version.py +++ b/lib/version.py @@ -1,4 +1,4 @@ # Version string. Examples: # '3.0.0' # '3.0.0-alpha9' -__version__ = '3.0.2' +__version__ = '3.0.3' diff --git a/requirements.txt b/requirements.txt index a3131aa..57f25bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -aiohttp==3.8.4 -libprobe==0.2.32 +aiohttp==3.8.5 +libprobe==0.2.34