epc-as-a-service functionality added
Change-Id: I85e9c725575df0044236e20b7900008755029ab2
diff --git a/xos/models.py b/xos/models.py
index 56350a7..f8d4c16 100644
--- a/xos/models.py
+++ b/xos/models.py
@@ -15,13 +15,16 @@
import traceback
from xos.exceptions import *
from xos.config import Config
-from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes.fields import GenericForeignKey
class VSMService(VSMService_decl):
class Meta:
proxy = True
+ def create_tenant(self, **kwargs):
+ t = VSMTenant(kind="vEPC", provider_service=self, connect_method="na", **kwargs)
+ t.save()
+ return t
+
class VSMTenant(VSMTenant_decl):
class Meta:
proxy = True
@@ -34,6 +37,13 @@
super(VSMTenant, self).__init__(*args, **kwargs)
def save(self, *args, **kwargs):
+ if not self.creator:
+ if not getattr(self, "caller", None):
+ raise XOSProgrammingError("VSMTenant's self.caller was not set")
+ self.creator = self.caller
+ if not self.creator:
+ raise XOSProgrammingError("VSMTenant's self.creator was not set")
+
super(VSMTenant, self).save(*args, **kwargs)
# This call needs to happen so that an instance is created for this
# tenant is created in the slice. One instance is created per tenant.
diff --git a/xos/tosca/custom_types/vsm.m4 b/xos/tosca/custom_types/vsm.m4
index 2c839a8..1613c4f 100644
--- a/xos/tosca/custom_types/vsm.m4
+++ b/xos/tosca/custom_types/vsm.m4
@@ -22,6 +22,3 @@
VSM Tenant
properties:
xos_base_tenant_props
- tenant_message:
- type: string
- required: false
diff --git a/xos/tosca/custom_types/vsm.yaml b/xos/tosca/custom_types/vsm.yaml
index a9603fb..ff8ef88 100644
--- a/xos/tosca/custom_types/vsm.yaml
+++ b/xos/tosca/custom_types/vsm.yaml
@@ -92,6 +92,3 @@
type: string
required: false
description: Service specific ID opaque to XOS but meaningful to service
- tenant_message:
- type: string
- required: false
diff --git a/xos/tosca/resources/vsmtenant.py b/xos/tosca/resources/vsmtenant.py
index e932953..4e84561 100644
--- a/xos/tosca/resources/vsmtenant.py
+++ b/xos/tosca/resources/vsmtenant.py
@@ -4,7 +4,7 @@
class XOSVSMTenant(XOSResource):
provides = "tosca.nodes.VSMTenant"
xos_model = VSMTenant
- copyin_props = ("tenant_message",)
+ copyin_props = ()
name_field = None
def get_xos_args(self, throw_exception=True):
diff --git a/xos/vsm.xproto b/xos/vsm.xproto
index 9a9848c..3093dba 100644
--- a/xos/vsm.xproto
+++ b/xos/vsm.xproto
@@ -12,5 +12,4 @@
message VSMTenant (TenantWithContainer){
option name = "VSMTenant";
option verbose_name = "Virtual Session Management Tenant";
- required string tenant_message = 1 [help_text = "Tenant Message to Display", max_length = 254, null = False, db_index = False, blank = False];
}