[CORD-1360] Using new config
Change-Id: I83438faa452f45fb11b3e278e35272a804ca5f9b
diff --git a/xos/attic/header.py b/xos/attic/header.py
index 99a1818..e7d33f1 100644
--- a/xos/attic/header.py
+++ b/xos/attic/header.py
@@ -10,7 +10,6 @@
from core.models.service import LeastLoadedNodeScheduler
import traceback
from xos.exceptions import *
-from xos.config import Config
class ConfigurationError(Exception):
@@ -23,5 +22,5 @@
# NOTE: don't change VROUTER_KIND unless you also change the reference to it
# in tosca/resources/network.py
-CORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
+CORD_USE_VTN = True
diff --git a/xos/header.py b/xos/header.py
index 99a1818..e7d33f1 100755
--- a/xos/header.py
+++ b/xos/header.py
@@ -10,7 +10,6 @@
from core.models.service import LeastLoadedNodeScheduler
import traceback
from xos.exceptions import *
-from xos.config import Config
class ConfigurationError(Exception):
@@ -23,5 +22,5 @@
# NOTE: don't change VROUTER_KIND unless you also change the reference to it
# in tosca/resources/network.py
-CORD_USE_VTN = getattr(Config(), "networking_use_vtn", False)
+CORD_USE_VTN = True
diff --git a/xos/synchronizer/model_deps b/xos/synchronizer/model-deps
similarity index 100%
rename from xos/synchronizer/model_deps
rename to xos/synchronizer/model-deps
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
index 27f18ff..8da47c1 100755
--- a/xos/synchronizer/run-from-api.sh
+++ b/xos/synchronizer/run-from-api.sh
@@ -1,2 +1 @@
-export XOS_DIR=/opt/xos
-python vrouter-synchronizer.py -C $XOS_DIR/synchronizers/vrouter/vrouter_from_api_config
+python vrouter-synchronizer.py
diff --git a/xos/synchronizer/vrouter-synchronizer.py b/xos/synchronizer/vrouter-synchronizer.py
index 6db012f..3e7a06c 100644
--- a/xos/synchronizer/vrouter-synchronizer.py
+++ b/xos/synchronizer/vrouter-synchronizer.py
@@ -5,6 +5,11 @@
import importlib
import os
import sys
+from xosconfig import Config
+
+config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/vrouter_config.yaml')
+
+Config.init(config_file, 'synchronizer-config-schema.yaml')
synchronizer_path = os.path.join(os.path.dirname(
os.path.realpath(__file__)), "../../synchronizers/new_base")
diff --git a/xos/synchronizer/vrouter_config.yaml b/xos/synchronizer/vrouter_config.yaml
new file mode 100644
index 0000000..681147a
--- /dev/null
+++ b/xos/synchronizer/vrouter_config.yaml
@@ -0,0 +1,7 @@
+name: vrouter-synchronizer
+accessor:
+ username: xosadmin@opencord.org
+ password: "@/opt/xos/services/vrouter/credentials/xosadmin@opencord.org"
+dependency_graph: "/opt/xos/synchronizers/vrouter/model-deps"
+steps_dir: "/opt/xos/synchronizers/vrouter/steps"
+sys_dir: "/opt/xos/synchronizers/vrouter/sys"
\ No newline at end of file
diff --git a/xos/synchronizer/vrouter_from_api_config b/xos/synchronizer/vrouter_from_api_config
deleted file mode 100644
index c3f1403..0000000
--- a/xos/synchronizer/vrouter_from_api_config
+++ /dev/null
@@ -1,20 +0,0 @@
-# Sets options for the synchronizer
-[observer]
-name=vrouter
-dependency_graph=/opt/xos/synchronizers/vrouter/model_deps
-steps_dir=/opt/xos/synchronizers/vrouter/steps
-sys_dir=/opt/xos/synchronizers/vrouter/sys
-#logfile=/var/log/xos_backend.log
-log_file=console
-log_level=debug
-pretend=False
-backoff_disabled=True
-save_ansible_output=True
-proxy_ssh=True
-proxy_ssh_key=/opt/cord_profile/node_key
-proxy_ssh_user=root
-accessor_kind=api
-accessor_password=@/opt/xos/services/vrouter/credentials/xosadmin@opencord.org
-
-[networking]
-use_vtn=True