summaryrefslogtreecommitdiffstats
path: root/conductor
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2018-09-05 07:59:36 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2018-09-05 07:59:36 -0700
commitb8d070b64894975f915d01fb3baf401f2411eb3a (patch)
tree50dfd3b29e8c2ffa0da95520d2de9686c30b7230 /conductor
parentf983a3cc032501782ab144b97aab269392b8db3d (diff)
Added the Authorization header for MUSIC
Fixed the Authorization header required for all MUSIC API. This was affecting the HAS CSIT as the keyspace was not getting created Change-Id: I1b22b9b71729e786f6ffb9baedf11d4475485e09 Issue-ID: OPTFRA-259 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'conductor')
-rw-r--r--conductor/conductor/common/music/api.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/conductor/conductor/common/music/api.py b/conductor/conductor/common/music/api.py
index b3bb5fc..2eeab3d 100644
--- a/conductor/conductor/common/music/api.py
+++ b/conductor/conductor/common/music/api.py
@@ -18,16 +18,15 @@
#
"""Music Data Store API"""
-
+import base64
import copy
import logging
import time
-from oslo_config import cfg
-from oslo_log import log
-
from conductor.common import rest
from conductor.i18n import _LE, _LI # pylint: disable=W0212
+from oslo_config import cfg
+from oslo_log import log
LOG = log.getLogger(__name__)
@@ -130,13 +129,12 @@ class MusicAPI(object):
self.rest = rest.REST(**kwargs)
if(CONF.music_api.music_new_version):
- MUSIC_version = CONF.music_api.music_version.split(".")
-
self.rest.session.headers['content-type'] = 'application/json'
- self.rest.session.headers['X-patchVersion'] = MUSIC_version[2]
self.rest.session.headers['ns'] = CONF.music_api.aafns
- self.rest.session.headers['userId'] = CONF.music_api.aafuser
- self.rest.session.headers['password'] = CONF.music_api.aafpass
+ auth_str = 'Basic {}'.format(base64.encodestring(
+ '{}:{}'.format(CONF.music_api.aafuser,
+ CONF.music_api.aafpass)).strip())
+ self.rest.session.headers['Authorization'] = auth_str
self.lock_ids = {}