summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhariharan97 <rh20085046@wipro.com>2021-03-09 11:18:40 +0530
committerhariharan97 <rh20085046@wipro.com>2021-03-09 15:10:59 +0530
commit575ac80f1bbfdb71436135d5a9762df51de05b83 (patch)
treeddb98729afe9714c479995da5c74b2c95db180b0
parentac7adf7d20eefc49727e439c7672ea9ce226ccb5 (diff)
Fix for has to communicate with SDC for Nst-selection enhancements
Issue-ID: OPTFRA-928 Signed-off-by: hariharan97 <rh20085046@wipro.com> Change-Id: I6d661e5482194d1ecd8e583c065ce1e77fa52b80
-rw-r--r--conductor/conductor/common/sms.py27
-rw-r--r--conductor/conductor/data/plugins/inventory_provider/sdc.py7
2 files changed, 21 insertions, 13 deletions
diff --git a/conductor/conductor/common/sms.py b/conductor/conductor/common/sms.py
index 35ca644..49f6411 100644
--- a/conductor/conductor/common/sms.py
+++ b/conductor/conductor/common/sms.py
@@ -20,13 +20,10 @@
'''Secret Management Service Integration'''
from conductor.common import config_loader
from onapsmsclient import Client
-
from oslo_config import cfg
from oslo_log import log
-import conductor.data.plugins.inventory_provider.aai
-import conductor.api.controllers.v1.plans
-import conductor.common.music.api
-import conductor.data.plugins.service_controller.sdnc
+
+
from conductor.common.utils import cipherUtils
LOG = log.getLogger(__name__)
@@ -35,8 +32,8 @@ CONF = cfg.CONF
AAF_SMS_OPTS = [
cfg.BoolOpt('is_enabled',
- default=True,
- help='Is Secret Management service enabled'),
+ default=True,
+ help='Is Secret Management service enabled'),
cfg.StrOpt('aaf_sms_url',
default='https://aaf-sms.onap:10443',
help='Base URL for SMS, up to and not including '
@@ -61,9 +58,12 @@ config_spec = {
def preload_secrets():
- """ This is intended to load the secrets required for testing Application
+ """This is intended to load the secrets required for testing Application
+
Actual deployment will have a preload script. Make sure the config is
- in sync"""
+
+ in sync
+ """
preload_config = config_loader.load_config_file(
config_spec.get("preload_secrets"))
domain = preload_config.get("domain")
@@ -113,6 +113,8 @@ def load_secrets():
config.set_override('username', secret_dict['aaf_api']['username'], 'aaf_api')
config.set_override('password', decrypt_pass(secret_dict['aaf_api']['password']), 'aaf_api')
config.set_override('aaf_conductor_user', secret_dict['aaf_api']['aaf_conductor_user'], 'aaf_api')
+ config.set_override('username', secret_dict['sdc']['username'], 'sdc')
+ config.set_override('password', decrypt_pass(secret_dict['sdc']['password']), 'sdc')
def decrypt_pass(passwd):
@@ -123,9 +125,12 @@ def decrypt_pass(passwd):
def delete_secrets():
- """ This is intended to delete the secrets for a clean initialization for
+ """This is intended to delete the secrets for a clean initialization for
+
testing Application. Actual deployment will have a preload script.
- Make sure the config is in sync"""
+
+ Make sure the config is in sync
+ """
config = CONF.aaf_sms
sms_url = config.aaf_sms_url
timeout = config.aaf_sms_timeout
diff --git a/conductor/conductor/data/plugins/inventory_provider/sdc.py b/conductor/conductor/data/plugins/inventory_provider/sdc.py
index 6f3cb4f..c69d7b0 100644
--- a/conductor/conductor/data/plugins/inventory_provider/sdc.py
+++ b/conductor/conductor/data/plugins/inventory_provider/sdc.py
@@ -57,7 +57,7 @@ SDC_OPTS = [
default='certificate_key.pem',
help='Private Certificate Key file in pem format.'),
cfg.StrOpt('certificate_authority_bundle_file',
- default='certificate_authority_bundle.pem',
+ default='',
help='Certificate Authority Bundle file in pem format. '
'Must contain the appropriate trust chain for the '
'Certificate file.'),
@@ -108,14 +108,16 @@ class SDC(object):
context=None, value=None):
"""Performs HTTP request."""
headers = {
- 'X-FromAppId': 'CONDUCTOR',
+ 'X-FromAppId': 'AAI',
'X-TransactionId': str(uuid.uuid4()),
+ 'X-ECOMP-InstanceID': 'AAI',
}
kwargs = {
"method": method,
"path": path,
"headers": headers,
"data": data,
+ "content_type": "application/octet-stream"
}
# TODO(jdandrea): Move timing/response logging into the rest helper?
@@ -144,6 +146,7 @@ class SDC(object):
"username": self.username,
"password": self.password,
"read_timeout": self.timeout,
+ "ca_bundle_file": self.verify,
}
self.rest = rest.REST(**kwargs)