convert concat to fstring

This commit is contained in:
Tony Fernandez 2024-10-23 18:26:22 -04:00
parent 2877c1ad0d
commit b42793a2dc

View File

@ -67,7 +67,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
elif username and password is not None:
logger.info(f'{config_filename}: Using user/pass auth with user {username} for Zabbix')
if not dry_run:
response = requests.post(base_url, headers=headers, data='{"jsonrpc":"2.0","method":"user.login","params":{"username":"'+username+'","password":"'+password+'"},"id":1}')
response = requests.post(base_url, headers=headers, data=f'{{"jsonrpc":"2.0","method":"user.login","params":{{"username":"{username}","password":"{password}"}},"id":1}}')
data['auth'] = response.json().get('result')
elif username is not None: