added small regex check to be sure that we have Salt URL starting from http or https
Change-Id: I1cff8586bff8d469b7fbaef104c84839497e9f05
diff --git a/cvp_checks/utils/__init__.py b/cvp_checks/utils/__init__.py
index 6ad3a6d..91501a8 100644
--- a/cvp_checks/utils/__init__.py
+++ b/cvp_checks/utils/__init__.py
@@ -12,7 +12,10 @@
class salt_remote:
def cmd(self, tgt, fun, param=None, expr_form=None, tgt_type=None):
config = get_configuration()
- url = config['SALT_URL']
+ url = config['SALT_URL'].strip()
+ if not re.match("^(http|https)://", url):
+ raise AuthenticationError("Salt URL should start \
+ with http or https, given - {}".format(url))
proxies = {"http": None, "https": None}
headers = {'Accept': 'application/json'}
login_payload = {'username': config['SALT_USERNAME'],