Skip to content

Commit

Permalink
Use https to use the rest api if not specified in node.dbopensvc
Browse files Browse the repository at this point in the history
As is already done for xmlrpc.
  • Loading branch information
cvaroqui committed Apr 16, 2018
1 parent daadcfa commit 5e021c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/node.py
Expand Up @@ -2621,6 +2621,8 @@ def collector_api(self, svcname=None):
data["username"] = username
data["password"] = password
data["url"] = rcEnv.dbopensvc.replace("/feed/default/call/xmlrpc", "/init/rest/api")
if not data["url"].startswith("http"):
data["url"] = "https://%s" % data["url"]
return data

def collector_auth_node(self):
Expand Down
2 changes: 2 additions & 0 deletions var/compliance/com.opensvc/comp.py
Expand Up @@ -291,6 +291,8 @@ def collector_api(self):
data["url"] = config.get("node", "dbopensvc").replace("/feed/default/call/xmlrpc", "")
data["url"] = data["url"].replace("/init/rest/api", "")
data["url"] += "/init/rest/api"
if not data["url"].startswith("http"):
data["url"] = "https://%s" % data["url"]
self.collector_api_cache = data
return self.collector_api_cache

Expand Down

0 comments on commit 5e021c2

Please sign in to comment.