Adding scheme support

Change-Id: I9f714875dbc6abf5f8eeef2542e3af0023d000db
This commit is contained in:
Andrey Pavlov 2017-02-15 20:56:44 +04:00
parent f5192e3f71
commit 88ce4abfd3
1 changed files with 11 additions and 5 deletions

View File

@ -551,11 +551,17 @@ def run_probe(probe):
if probe["type"] == "exec":
run_cmd(probe["command"])
elif probe["type"] == "httpGet":
url = "http://{}:{}{}".format(
VARIABLES["network_topology"]["private"]["address"],
probe["port"],
probe.get("path", "/"))
resp = requests.get(url)
scheme = probe.get("scheme", "http")
kwargs = {
"url": "{}://{}:{}{}".format(
scheme,
VARIABLES["network_topology"]["private"]["address"],
probe["port"],
probe.get("path", "/"))
}
if scheme == "https":
kwargs['cert'] = CACERT
resp = requests.get(**kwargs)
resp.raise_for_status()