CORD-1008 Dockerfile and docker-compose for vtn synchronizer
Change-Id: Ia6624c199624fcb9d497da1326220353c5d2614b
diff --git a/xos/synchronizer/steps/sync_onos_netcfg.py b/xos/synchronizer/steps/sync_onos_netcfg.py
index b6f427d..056c1be 100644
--- a/xos/synchronizer/steps/sync_onos_netcfg.py
+++ b/xos/synchronizer/steps/sync_onos_netcfg.py
@@ -27,7 +27,9 @@
self.call()
def get_node_tag(self, node, tagname):
- tags = Tag.select_by_content_object(node).filter(name=tagname)
+ tags = Tag.objects.filter(content_type=model_accessor.get_content_type_id(node),
+ object_id=node.id,
+ name=tagname)
return tags[0].value
def get_tenants_who_want_config(self):
@@ -41,7 +43,7 @@
return tenants
def save_tenant_attribute(self, tenant, name, value):
- tas = TenantAttribute.objects.filter(tenant=tenant, name=name)
+ tas = TenantAttribute.objects.filter(tenant_id=tenant.id, name=name)
if tas:
ta = tas[0]
if ta.value != value:
@@ -145,10 +147,8 @@
# Generate apps->org.onosproject.cordvtn->cordvtn->publicGateways
# Pull the gateway information from vRouter
- try:
- from services.vrouter.models import VRouterService
-
- vrouters = VRouterService.get_service_objects().all()
+ if model_accessor.has_model_class("VRouterService"):
+ vrouters = VRouterService.objects.all()
if vrouters:
for gateway in vrouters[0].get_gateways():
gatewayIp = gateway['gateway_ip'].split('/',1)[0]
@@ -158,13 +158,13 @@
"gatewayMac": gatewayMac
}
data["apps"]["org.opencord.vtn"]["cordvtn"]["publicGateways"].append(gateway_dict)
- except:
+ else:
logger.info("No VRouter service present, not adding publicGateways to config")
return json.dumps(data, indent=4, sort_keys=True)
def call(self, **args):
- vtn_service = VTNService.get_service_objects().all()
+ vtn_service = VTNService.objects.all()
if not vtn_service:
raise Exception("No VTN Service")
diff --git a/xos/synchronizer/steps/sync_port_addresses.py b/xos/synchronizer/steps/sync_port_addresses.py
index 57de70b..029755b 100644
--- a/xos/synchronizer/steps/sync_port_addresses.py
+++ b/xos/synchronizer/steps/sync_port_addresses.py
@@ -10,6 +10,8 @@
logger = Logger(level=logging.INFO)
+# TODO: This file seems obsolete -- evaluate for deletion.
+
# XXX should save and load this
glo_saved_vtn_maps = []
diff --git a/xos/synchronizer/steps/sync_vtn_service.py b/xos/synchronizer/steps/sync_vtn_service.py
index 44e29d7..6db26f8 100644
--- a/xos/synchronizer/steps/sync_vtn_service.py
+++ b/xos/synchronizer/steps/sync_vtn_service.py
@@ -212,7 +212,7 @@
logger.error("Received error from vtn service (%d)" % r.status_code)
def call(self, **args):
- vtn_service = VTNService.get_service_objects().all()
+ vtn_service = VTNService.objects.all()
if not vtn_service:
raise Exception("No VTN Service")