Skip to content

Commit 3a4e079

Browse files
committed
[patch] Add verify sls connection function
1 parent e2cab24 commit 3a4e079

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_version(rel_path):
6161
'kubeconfig', # BSD License
6262
'jinja2', # BSD License
6363
'jinja2-base64-filters', # MIT License
64-
# 'requests' # Apache Software License
64+
'requests' # Apache Software License
6565
],
6666
extras_require={
6767
'dev': [

src/mas/devops/sls.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
# import requests
2+
import requests
33
from openshift.dynamic import DynamicClient
44
from openshift.dynamic.exceptions import NotFoundError, ResourceNotFoundError, UnauthorizedError
55

@@ -24,10 +24,9 @@ def listSLSInstances(dynClient: DynamicClient) -> list:
2424
return []
2525

2626

27-
# def verifySLSConnection(sls_url: str, server_ca: str) -> bool:
28-
# logger.info("Checking SLS connection")
29-
# response = requests.get(f"{sls_url}api/probes/readiness", verify=server_ca)
30-
# if response.status_code == 200:
31-
# return True
32-
# return False
33-
# # response.raise_for_status()
27+
def verifySLSConnection(sls_url: str, server_ca: str) -> bool:
28+
logger.info("Checking SLS connection")
29+
response = requests.get(f"{sls_url}api/probes/readiness", verify=server_ca)
30+
if response.status_code == 200:
31+
return True
32+
return False

0 commit comments

Comments
 (0)