Read list type of environment variables
DBAAS Helm Charts appconfig has been changed to have individual ports
and master names for each SDL cluster due to problems seen with DBAAS
upgrade and rollback caused by re-allocation of the same address/port
of Redis to some other SDL cluster. Implement support for new list type
environment variables reading in SDL:
* DBAAS_SERVICE_PORT
* DBAAS_SERVICE_SENTINEL_PORT
* DBAAS_MASTER_NAME
Issue-Id: RIC-698
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Id75e53c3542f2c2b24a2fd815a5583b1394d8d79
diff --git a/ricsdl-package/examples/notify.py b/ricsdl-package/examples/notify.py
index 006001f..47d9b04 100755
--- a/ricsdl-package/examples/notify.py
+++ b/ricsdl-package/examples/notify.py
@@ -38,13 +38,16 @@
* Following environment variables are needed to set to the pod/container where the application
utilizing SDL is going to be run.
DBAAS_SERVICE_HOST = [DB service address]
- DBAAS_SERVICE_PORT= [DB service port]
- DBAAS_MASTER_NAME = [DB name]. Needed to set only if Redis sentinel is used to provide high
- availability for Redis DB solution.
- DBAAS_SERVICE_SENTINEL_PORT = [Redis sentinel port number]. Needed to set only if Redis
- sentinel is in use.
- DBASS_CLUSTER_ADDR_LIST = [list of DB service addresses]. Is set only if more than one
- Redis sentinel groups are in use.
+ DBAAS_SERVICE_PORT= [Comma separated list of DB service ports]. Only one port supported in
+ RIC deployments, Nokia SEP deployments can have multiple ports.
+ DBAAS_MASTER_NAME = [Comma separated list of DB names]. Needed to set only if Redis
+ sentinel is used to provide high availability for Redis DB solution. Only one DB name
+ supported in RIC deployments, Nokia SEP deployments can have multiple DB names.
+ DBAAS_SERVICE_SENTINEL_PORT = [Comma separated list of Redis sentinel port number]. Needed
+ to set only if Redis sentinel is in use. Only one port supported in RIC deployments, Nokia
+ SEP deployments can have multiple ports.
+ DBASS_CLUSTER_ADDR_LIST = [Comma separated list of DB service addresses]. Is set only if
+ more than one Redis sentinel groups are in use. Only in use in Nokia SEP deployments.
In official RIC deployments four first environment variables are defined in Helm configMaps
of the DBaaS and these configurations can be loaded automatically as environment variables
into application pods via `envFrom dbaas-appconfig` statement in an application Helm Charts.
diff --git a/ricsdl-package/examples/sync.py b/ricsdl-package/examples/sync.py
index 618586d..ce6ad20 100755
--- a/ricsdl-package/examples/sync.py
+++ b/ricsdl-package/examples/sync.py
@@ -1,5 +1,5 @@
# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2018-2019 Nokia.
+# Copyright (c) 2018-2022 Nokia.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -40,18 +40,22 @@
* Following environment variables are needed to set to the pod/container where the application
utilizing SDL is going to be run.
DBAAS_SERVICE_HOST = [DB service address]
- DBAAS_SERVICE_PORT= [DB service port]
- DBAAS_MASTER_NAME = [DB name]. Needed to set only if Redis sentinel is used to provide high
- availability for Redis DB solution.
- DBAAS_SERVICE_SENTINEL_PORT = [Redis sentinel port number]. Needed to set only if Redis
- sentinel is in use.
- DBASS_CLUSTER_ADDR_LIST = [list of DB service addresses]. Is set only if more than one
- Redis sentinel groups are in use.
+ DBAAS_SERVICE_PORT= [Comma separated list of DB service ports]. Only one port supported in
+ RIC deployments, Nokia SEP deployments can have multiple ports.
+ DBAAS_MASTER_NAME = [Comma separated list of DB names]. Needed to set only if Redis
+ sentinel is used to provide high availability for Redis DB solution. Only one DB name
+ supported in RIC deployments, Nokia SEP deployments can have multiple DB names.
+ DBAAS_SERVICE_SENTINEL_PORT = [Comma separated list of Redis sentinel port number]. Needed
+ to set only if Redis sentinel is in use. Only one port supported in RIC deployments, Nokia
+ SEP deployments can have multiple ports.
+ DBASS_CLUSTER_ADDR_LIST = [Comma separated list of DB service addresses]. Is set only if
+ more than one Redis sentinel groups are in use. Only in use in Nokia SEP deployments.
In official RIC deployments four first environment variables are defined in Helm configMaps
of the DBaaS and these configurations can be loaded automatically as environment variables
into application pods via `envFrom dbaas-appconfig` statement in an application Helm Charts.
The last environment variable is not for time being in use in official RIC deployments, only
in Nokia SEP deployments.
+
"""
from ricsdl.syncstorage import SyncStorage
from ricsdl.exceptions import RejectedByBackend, NotConnected, BackendError