CORD-1345: Rename PlCoreBase to XOSBase
Change-Id: I97797031d33fffcf482c2d209ed8532932cde56a
diff --git a/xos/attic/header.py b/xos/attic/header.py
index 0f04064..99a1818 100644
--- a/xos/attic/header.py
+++ b/xos/attic/header.py
@@ -1,6 +1,6 @@
from django.db import models
-from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
-from core.models.plcorebase import StrippedCharField
+from core.models import Service, XOSBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
+from core.models.xosbase import StrippedCharField
import os
from django.db import models, transaction
from django.forms.models import model_to_dict
diff --git a/xos/header.py b/xos/header.py
deleted file mode 120000
index 721b5c0..0000000
--- a/xos/header.py
+++ /dev/null
@@ -1 +0,0 @@
-attic/header.py
\ No newline at end of file
diff --git a/xos/header.py b/xos/header.py
new file mode 100755
index 0000000..99a1818
--- /dev/null
+++ b/xos/header.py
@@ -0,0 +1,27 @@
+from django.db import models
+from core.models import Service, XOSBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, NetworkParameter, NetworkParameterType, Port, AddressPool
+from core.models.xosbase import StrippedCharField
+import os
+from django.db import models, transaction
+from django.forms.models import model_to_dict
+from django.db.models import *
+from operator import itemgetter, attrgetter, methodcaller
+from core.models import Tag
+from core.models.service import LeastLoadedNodeScheduler
+import traceback
+from xos.exceptions import *
+from xos.config import Config
+
+
+class ConfigurationError(Exception):
+ pass
+
+
+VROUTER_KIND = "vROUTER"
+APP_LABEL = "vrouter"
+
+# 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)
+
diff --git a/xos/models.py b/xos/models.py
index 09ef583..0419fbe 100644
--- a/xos/models.py
+++ b/xos/models.py
@@ -34,7 +34,7 @@
-class VRouterApp(PlCoreBase):
+class VRouterApp(XOSBase):
KIND = "vROUTER"
@@ -69,7 +69,7 @@
-class VRouterDevice(PlCoreBase):
+class VRouterDevice(XOSBase):
KIND = "vROUTER"
@@ -95,7 +95,7 @@
-class VRouterInterface(PlCoreBase):
+class VRouterInterface(XOSBase):
KIND = "vROUTER"
@@ -120,7 +120,7 @@
-class VRouterIp(PlCoreBase):
+class VRouterIp(XOSBase):
KIND = "vROUTER"
@@ -144,7 +144,7 @@
-class VRouterPort(PlCoreBase):
+class VRouterPort(XOSBase):
KIND = "vROUTER"
diff --git a/xos/vrouter.xproto b/xos/vrouter.xproto
index b79b30c..b816307 100644
--- a/xos/vrouter.xproto
+++ b/xos/vrouter.xproto
@@ -9,7 +9,7 @@
required string rest_pass = 4 [default = "rocks", max_length = 255, content_type = "stripped", blank = False, null = False, db_index = False];
}
-message VRouterDevice (PlCoreBase){
+message VRouterDevice (XOSBase){
optional string name = 1 [help_text = "device friendly name", max_length = 20, null = True, db_index = False, blank = True];
required string openflow_id = 2 [help_text = "device identifier in ONOS", max_length = 20, null = False, db_index = False, blank = False];
required string config_key = 3 [default = "basic", max_length = 32, blank = False, help_text = "configuration key", null = False, db_index = False];
@@ -17,28 +17,28 @@
required manytoone vrouter_service->VRouterService:devices = 5 [db_index = True, null = False, blank = False];
}
-message VRouterPort (PlCoreBase){
+message VRouterPort (XOSBase){
optional string name = 1 [help_text = "port friendly name", max_length = 20, null = True, db_index = False, blank = True];
required string openflow_id = 2 [help_text = "port identifier in ONOS", max_length = 21, null = False, db_index = False, blank = False];
required manytoone vrouter_device->VRouterDevice:ports = 3 [db_index = True, null = False, blank = False];
required manytoone vrouter_service->VRouterService:device_ports = 4 [db_index = True, null = False, blank = False];
}
-message VRouterApp (PlCoreBase){
+message VRouterApp (XOSBase){
required manytoone vrouter_service->VRouterService:apps = 1 [db_index = True, null = False, blank = False];
required string name = 2 [help_text = "application name", max_length = 50, null = False, db_index = False, blank = False];
required string control_plane_connect_point = 3 [help_text = "port identifier in ONOS", max_length = 21, null = False, db_index = False, blank = False];
required bool ospf_enabled = 4 [help_text = "ospf enabled", default = True, null = False, db_index = False, blank = True];
}
-message VRouterInterface (PlCoreBase) {
+message VRouterInterface (XOSBase) {
required manytoone vrouter_port->VRouterPort:interfaces = 1 [db_index = True, null = False, blank = False];
required string name = 2 [help_text = "interface name", max_length = 10, null = False, db_index = False, blank = False];
required string mac = 3 [help_text = "interface mac", max_length = 17, null = False, db_index = False, blank = False];
optional string vlan = 4 [help_text = "interface vlan id", max_length = 10, null = True, db_index = False, blank = True];
}
-message VRouterIp (PlCoreBase){
+message VRouterIp (XOSBase){
optional string name = 1 [help_text = "ip friendly name", max_length = 20, null = True, db_index = False, blank = True];
required manytoone vrouter_interface->VRouterInterface:ips = 2 [db_index = True, null = False, blank = False];
required string ip = 3 [help_text = "interface ips", max_length = 19, null = False, db_index = False, blank = False];