Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Nov 6, 2024
1 parent 0f27495 commit a6b417e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
14 changes: 2 additions & 12 deletions lib/check/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ async def check_alerts(
asset: Asset,
asset_config: dict,
check_config: dict) -> dict:
try:
token = await get_token(asset, asset_config, check_config)
except Exception:
logging.exception('Failed to retrieve token')
raise

try:
state = await get_logs_alert(asset, check_config, token)
except Exception:
logging.exception('Failed to get alerts')
raise

token = await get_token(asset, asset_config, check_config)
state = await get_logs_alert(asset, check_config, token)
return state
3 changes: 3 additions & 0 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ async def get_token(
protocol = 'https' if secure else 'http'
url = f'{protocol}://{address}:{port}/api/access/{api_version}'

logging.debug(f'Headers: {headers}')
logging.info(f'POST {url}')

async with aiohttp.ClientSession() as session:
async with session.post(url, headers=headers, ssl=False) as resp:
assert resp.status // 100 == 2, \
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-alpha0'
__version__ = '3.0.0-alpha3'
__version__ = '3.0.0-alpha4'

0 comments on commit a6b417e

Please sign in to comment.