migrate vEE to master
Change-Id: Ie451914a395ad8a8df20fb8df1054d55ce0eb263
diff --git a/xos/synchronizer/Dockerfile.synchronizer b/xos/synchronizer/Dockerfile.synchronizer
index 4f6f9c1..c48c1bb 100644
--- a/xos/synchronizer/Dockerfile.synchronizer
+++ b/xos/synchronizer/Dockerfile.synchronizer
@@ -22,4 +22,4 @@
WORKDIR "/opt/xos/synchronizers/vee"
-CMD bash -c "cd /opt/xos/synchronizers/vee; ./run-from-api.sh"
\ No newline at end of file
+CMD bash -c "cd /opt/xos/synchronizers/vee; chmod 755 ./run-from-api.sh; ./run-from-api.sh"
\ No newline at end of file
diff --git a/xos/synchronizer/run-from-api.sh b/xos/synchronizer/run-from-api.sh
index 87d4e08..affc3bc 100644
--- a/xos/synchronizer/run-from-api.sh
+++ b/xos/synchronizer/run-from-api.sh
@@ -13,7 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-export XOS_DIR=/opt/xos
-python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_from_api_config
-
+python vee-synchronizer.py
\ No newline at end of file
diff --git a/xos/synchronizer/run.sh b/xos/synchronizer/run.sh
deleted file mode 100755
index 737ba09..0000000
--- a/xos/synchronizer/run.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-export XOS_DIR=/opt/xos
-python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_synchronizer_config
diff --git a/xos/synchronizer/stop.sh b/xos/synchronizer/stop.sh
deleted file mode 100755
index aae4d9d..0000000
--- a/xos/synchronizer/stop.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-pkill -9 -f vee-synchronizer.py
diff --git a/xos/synchronizer/vee-synchronizer.py b/xos/synchronizer/vee-synchronizer.py
index 34ac99b..6e813df 100644
--- a/xos/synchronizer/vee-synchronizer.py
+++ b/xos/synchronizer/vee-synchronizer.py
@@ -16,11 +16,14 @@
#!/usr/bin/env python
-# This imports and runs ../../xos-observer.py
-
import importlib
import os
import sys
+from xosconfig import Config
+
+config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/vee_config.yaml')
+Config.init(config_file, 'synchronizer-config-schema.yaml')
+
observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
sys.path.append(observer_path)
mod = importlib.import_module("xos-synchronizer")
diff --git a/xos/synchronizer/start.sh b/xos/synchronizer/vee_config.yaml
old mode 100755
new mode 100644
similarity index 67%
rename from xos/synchronizer/start.sh
rename to xos/synchronizer/vee_config.yaml
index 4b4f313..1c79c89
--- a/xos/synchronizer/start.sh
+++ b/xos/synchronizer/vee_config.yaml
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-export XOS_DIR=/opt/xos
-nohup python vee-synchronizer.py -C $XOS_DIR/synchronizers/vee/vee_synchronizer_config > /dev/null 2>&1 &
+name: vee-synchronizer
+accessor:
+ username: xosadmin@opencord.org
+ password: "@/opt/xos/services/vee/credentials/xosadmin@opencord.org"
+dependency_graph: "/opt/xos/synchronizers/vee/model-deps"
+steps_dir: "/opt/xos/synchronizers/vee/steps"
+sys_dir: "/opt/xos/synchronizers/vee/sys"
diff --git a/xos/synchronizer/vee_from_api_config b/xos/synchronizer/vee_from_api_config
deleted file mode 100644
index cdddc09..0000000
--- a/xos/synchronizer/vee_from_api_config
+++ /dev/null
@@ -1,20 +0,0 @@
-# Sets options for the synchronizer
-[observer]
-name=vee
-dependency_graph=/opt/xos/synchronizers/vee/model-deps
-steps_dir=/opt/xos/synchronizers/vee/steps
-sys_dir=/opt/xos/synchronizers/vee/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/vee/credentials/xosadmin@opencord.org
-
-[networking]
-use_vtn=True
\ No newline at end of file
diff --git a/xos/synchronizer/vee_synchronizer_config b/xos/synchronizer/vee_synchronizer_config
deleted file mode 100644
index 82e3b97..0000000
--- a/xos/synchronizer/vee_synchronizer_config
+++ /dev/null
@@ -1,23 +0,0 @@
-# Required by XOS
-[db]
-name=xos
-user=postgres
-password=password
-host=xos_db
-port=5432
-
-# Required by XOS
-[api]
-nova_enabled=True
-
-# Sets options for the synchronizer
-[observer]
-name=vee
-dependency_graph=/opt/xos/synchronizers/vee/model-deps
-steps_dir=/opt/xos/synchronizers/vee/steps
-sys_dir=/opt/xos/synchronizers/vee/sys
-logfile=console
-pretend=False
-backoff_disabled=True
-save_ansible_output=True
-proxy_ssh=False