[CORD-3022] Splitting config
Change-Id: I157ca24ccf41b390e7c4cdb787d346a956f31b2f
diff --git a/xos/synchronizer/openstack_config.yaml b/xos/synchronizer/config.yaml
similarity index 86%
rename from xos/synchronizer/openstack_config.yaml
rename to xos/synchronizer/config.yaml
index fdc1c57..ac3a5f7 100644
--- a/xos/synchronizer/openstack_config.yaml
+++ b/xos/synchronizer/config.yaml
@@ -13,11 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-name: openstack
-accessor:
- username: xosadmin@opencord.org
- password: "@/opt/xos/services/openstack/credentials/xosadmin@opencord.org"
+name: openstack-synchronizer
dependency_graph: "/opt/xos/synchronizers/openstack/model-deps"
steps_dir: "/opt/xos/synchronizers/openstack/steps"
pull_steps_dir: "/opt/xos/synchronizers/openstack/pull_steps"
@@ -41,3 +37,13 @@
nova:
ca_ssl_cert: "/etc/ssl/certs/ca-certificates.crt"
enabled: True
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ level: DEBUG
diff --git a/xos/synchronizer/openstack-synchronizer.py b/xos/synchronizer/openstack-synchronizer.py
index 57ed48b..e86e6f3 100644
--- a/xos/synchronizer/openstack-synchronizer.py
+++ b/xos/synchronizer/openstack-synchronizer.py
@@ -21,8 +21,13 @@
sys.path.append('/opt/xos')
from xosconfig import Config
-config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/openstack_config.yaml')
-Config.init(config_file, 'synchronizer-config-schema.yaml')
+base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
+mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
+
+if os.path.isfile(mounted_config_file):
+ Config.init(base_config_file, 'synchronizer-config-schema.yaml', mounted_config_file)
+else:
+ Config.init(base_config_file, 'synchronizer-config-schema.yaml')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from xos.logger import Logger, logging, logger