From e85e4284a72bc4e56ddbfb9eea3dd3c803c157ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20Garc=C3=ADa?= Date: Fri, 1 Aug 2014 10:13:54 +0200 Subject: [PATCH] Added basic authentication to SLA-Collector requests --- myslice/settings.py | 9 +++------ sla/slaclient/restclient.py | 9 ++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/myslice/settings.py b/myslice/settings.py index e72d01b0..dadc27c6 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -293,9 +293,6 @@ CSRF_FAILURE_VIEW = 'manifoldapi.manifoldproxy.csrf_failure' ####SLA##### -#SLA_MANAGER_URL = "http://157.193.215.125:4000/sla-service" -# SLA_MANAGER_USER = "normal_user" -# SLA_MANAGER_PASSWORD = "password" -SLA_MANAGER_URL = "http://172.24.76.49:8000/sla" -SLA_MANAGER_USER = "" -SLA_MANAGER_PASSWORD = "" +SLA_MANAGER_URL = "http://172.24.76.62:8000/sla" +SLA_MANAGER_USER = "portal" +SLA_MANAGER_PASSWORD = "password" diff --git a/sla/slaclient/restclient.py b/sla/slaclient/restclient.py index 879c7a1b..29fcae82 100755 --- a/sla/slaclient/restclient.py +++ b/sla/slaclient/restclient.py @@ -114,12 +114,11 @@ class Client(object): url = _buildpath_(self.rooturl, path) if "testbed" in kwargs: url = url + "?testbed=" + kwargs["testbed"] - #kwargs['params']['testbed'] = 'iminds' if "headers" not in kwargs: kwargs["headers"] = {"accept": "application/xml"} - # kwargs["auth"] = HTTPBasicAuth(settings.SLA_MANAGER_USER, - # settings.SLA_MANAGER_PASSWORD) + kwargs["auth"] = HTTPBasicAuth(settings.SLA_MANAGER_USER, + settings.SLA_MANAGER_PASSWORD) for key, values in kwargs.iteritems(): print key, values @@ -152,8 +151,8 @@ class Client(object): """ url = _buildpath_(self.rooturl, path) url = url + "?testbed=iminds" # TODO remove hardcoded string - # kwargs["auth"] = HTTPBasicAuth(settings.SLA_MANAGER_USER, - # settings.SLA_MANAGER_PASSWORD) + kwargs["auth"] = HTTPBasicAuth(settings.SLA_MANAGER_USER, + settings.SLA_MANAGER_PASSWORD) if "headers" not in kwargs: kwargs = {"accept": "application/xml", "content-type": "application/xml"} -- 2.43.0