Automatic style fix

This commit is contained in:
robot-clickhouse 2023-05-22 08:30:04 +00:00
parent 855f0abcf9
commit a0b384bc48

View File

@ -165,13 +165,13 @@ def execute_query_https(
query, user, enable_ssl_auth=True, cert_name=None, password=None
):
url = f"https://{instance.ip_address}:{HTTPS_PORT}/?query={query}"
headers = {"X-ClickHouse-User":user}
headers = {"X-ClickHouse-User": user}
if enable_ssl_auth:
headers["X-ClickHouse-SSL-Certificate-Auth"] = "on"
if password:
headers["X-ClickHouse-Key"] = password
http_client=urllib3.PoolManager(ssl_context=get_ssl_context(cert_name))
response = http_client.request('GET', url, headers=headers)
http_client = urllib3.PoolManager(ssl_context=get_ssl_context(cert_name))
response = http_client.request("GET", url, headers=headers)
if response.status != 200:
raise Exception(response.status)
return response.data.decode("utf-8")