CORD-1008 port vtn synchronizer to new_base
Change-Id: Ib3883dd978dd6ff09cb83380f98c57203bdae346
diff --git a/xos/synchronizer/steps/sync_onos_netcfg.py b/xos/synchronizer/steps/sync_onos_netcfg.py
index 8c157e3..b6f427d 100644
--- a/xos/synchronizer/steps/sync_onos_netcfg.py
+++ b/xos/synchronizer/steps/sync_onos_netcfg.py
@@ -4,9 +4,8 @@
import sys
import base64
import json
-from synchronizers.base.syncstep import SyncStep
-from core.models import Service, Slice, Controller, ControllerSlice, ControllerUser, Node, TenantAttribute, Tag, ModelLink, AddressPool
-from services.vtn.models import VTNService
+from synchronizers.new_base.syncstep import SyncStep
+from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
logger = Logger(level=logging.INFO)
diff --git a/xos/synchronizer/steps/sync_port_addresses.py b/xos/synchronizer/steps/sync_port_addresses.py
index b3a7837..57de70b 100644
--- a/xos/synchronizer/steps/sync_port_addresses.py
+++ b/xos/synchronizer/steps/sync_port_addresses.py
@@ -3,18 +3,10 @@
import socket
import sys
import base64
-from django.db.models import F, Q
from xos.config import Config
-from synchronizers.base.syncstep import SyncStep
-from core.models import Service, Port, Controller, Tag, Tenant
-from core.models.service import COARSE_KIND
+from synchronizers.new_base.syncstep import SyncStep
+from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
-from requests.auth import HTTPBasicAuth
-from services.vtn.models import VTNService
-
-# hpclibrary will be in steps/..
-parentdir = os.path.join(os.path.dirname(__file__),"..")
-sys.path.insert(0,parentdir)
logger = Logger(level=logging.INFO)
@@ -32,7 +24,7 @@
def call(self, **args):
global glo_saved_vtn_maps
- vtn_service = VTNService.get_service_objects().all()
+ vtn_service = VTNService.objects.all()
if not vtn_service:
raise Exception("SyncPortAddresses: No VTN Service")
vtn_service = vtn_service[0]
@@ -49,7 +41,7 @@
logger.info("sync'ing vsg tenant to port addresses")
- for vsg in VSGTenant.get_tenant_objects().all():
+ for vsg in VSGTenant.objects.all():
if not vsg.instance:
logger.info("skipping vsg %s because it has no instance" % vsg)
diff --git a/xos/synchronizer/steps/sync_vtn_service.py b/xos/synchronizer/steps/sync_vtn_service.py
index 3b775f1..44e29d7 100644
--- a/xos/synchronizer/steps/sync_vtn_service.py
+++ b/xos/synchronizer/steps/sync_vtn_service.py
@@ -3,20 +3,13 @@
import socket
import sys
import base64
-from django.db.models import F, Q
from xos.config import Config
-from synchronizers.base.syncstep import SyncStep
-from core.models import Service, Network, Port
-from core.models.service import COARSE_KIND
from services.vtn.vtnnetport import VTNNetwork, VTNPort
-from services.vtn.models import VTNService
+from synchronizers.new_base.syncstep import SyncStep
+from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
from requests.auth import HTTPBasicAuth
-# hpclibrary will be in steps/..
-parentdir = os.path.join(os.path.dirname(__file__),"..")
-sys.path.insert(0,parentdir)
-
logger = Logger(level=logging.INFO)
# XXX should save and load this
@@ -33,9 +26,7 @@
SyncStep.__init__(self, **args)
def get_vtn_onos_service(self):
- from services.onos.models import ONOSService
-
- vtn_service = ONOSService.get_service_objects().filter(name="ONOS_CORD") # XXX fixme - harcoded
+ vtn_service = ONOSService.objects.filter(name="ONOS_CORD") # XXX fixme - harcoded
if not vtn_service:
raise "No VTN Onos Service"