Add AAI_SERVICE_URL environment variable 11/46711/1
authorVictor Morales <victor.morales@intel.com>
Wed, 9 May 2018 00:18:21 +0000 (17:18 -0700)
committerVictor Morales <victor.morales@intel.com>
Wed, 9 May 2018 00:18:21 +0000 (17:18 -0700)
The settings.py file uses the values of AAI_ADDR and AAI_PORT to
create AAI_SERVICE_URL config value. This last value uses a template
which contains the https protocol. Using secure protocols are good
practice for production deployments but can be a restriction during
testing. This change allows to modify this value.

Change-Id: Idc7b0b709caf79e03c2f66774ef780223b913946
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: MULTICLOUD-214

ocata/docker/Dockerfile
ocata/ocata/settings.py

index 1b8477f..8688328 100644 (file)
@@ -10,6 +10,7 @@ ENV MSB_ADDR "127.0.0.1"
 ENV MSB_PORT "80"
 ENV AAI_ADDR "aai.api.simpledemo.openecomp.org"
 ENV AAI_PORT "8443"
+ENV AAI_SERVICE_URL
 ENV AAI_SCHEMA_VERSION "v13"
 ENV AAI_USERNAME "AAI"
 ENV AAI_PASSWORD "AAI"
@@ -28,4 +29,4 @@ RUN apt-get update && \
     pip install -r /opt/ocata/requirements.txt
 
 WORKDIR /opt/ocata
-CMD /bin/sh -c /opt/ocata/run.sh
\ No newline at end of file
+CMD /bin/sh -c /opt/ocata/run.sh
index 9a205ab..7934437 100644 (file)
@@ -100,7 +100,7 @@ MULTICLOUD_PREFIX = "http://%s:%s/api/multicloud-ocata/v0" % (
 # [A&AI]
 AAI_ADDR = os.environ.get('AAI_ADDR', "aai.api.simpledemo.openecomp.org")
 AAI_PORT = os.environ.get('AAI_PORT', "8443")
-AAI_SERVICE_URL = 'https://%s:%s/aai' % (AAI_ADDR, AAI_PORT)
+AAI_SERVICE_URL = os.environ.get('AAI_SERVICE_URL', 'https://%s:%s/aai' % (AAI_ADDR, AAI_PORT))
 AAI_SCHEMA_VERSION = os.environ.get('AAI_SCHEMA_VERSION', "v13")
 AAI_USERNAME = os.environ.get('AAI_USERNAME', "AAI")
 AAI_PASSWORD = os.environ.get('AAI_PASSWORD', "AAI")