Skip to content

Commit

Permalink
Upd requitements, add global_protect bool
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Sep 4, 2023
1 parent 948d0af commit 24b13ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version string. Examples:
# '3.0.0'
# '3.0.0-alpha9'
__version__ = '3.0.2'
__version__ = '3.0.3'
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aiohttp==3.8.4
libprobe==0.2.32
aiohttp==3.8.5
libprobe==0.2.34

0 comments on commit 24b13ca

Please sign in to comment.