CORD-1008 update onos synchronizer to use new_base
Change-Id: I6ed2ad3ce67725bb132e81538a54c608beb868ef
diff --git a/xos/synchronizer/steps/sync_onosservice.py b/xos/synchronizer/steps/sync_onosservice.py
index 6332fc9..e038949 100644
--- a/xos/synchronizer/steps/sync_onosservice.py
+++ b/xos/synchronizer/steps/sync_onosservice.py
@@ -4,19 +4,11 @@
import sys
import base64
import time
-from django.db.models import F, Q
from xos.config import Config
-from synchronizers.base.syncstep import SyncStep
-from synchronizers.base.ansible_helper import run_template_ssh
-from synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
-from core.models import Service, Slice
-from services.onos.models import ONOSService, ONOSApp
+from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
+from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
-# hpclibrary will be in steps/..
-parentdir = os.path.join(os.path.dirname(__file__),"..")
-sys.path.insert(0,parentdir)
-
logger = Logger(level=logging.INFO)
class SyncONOSService(SyncInstanceUsingAnsible):
@@ -24,19 +16,10 @@
observes=ONOSService
requested_interval=0
template_name = "sync_onosservice.yaml"
- #service_key_name = "/opt/xos/synchronizers/onos/onos_key"
def __init__(self, *args, **kwargs):
super(SyncONOSService, self).__init__(*args, **kwargs)
- def fetch_pending(self, deleted):
- if (not deleted):
- objs = ONOSService.get_service_objects().filter(Q(enacted__lt=F('updated')) | Q(enacted=None),Q(lazy_blocked=False))
- else:
- objs = ONOSService.get_deleted_service_objects()
-
- return objs
-
def get_instance(self, o):
# We assume the ONOS service owns a slice, so pick one of the instances
# inside that slice to sync to.