CORD-1250 Update to new Service/Tenancy models
Change-Id: Ib64b8b627bcf7b64bc28838005e3dd70c0800fde
diff --git a/xos/tosca/resources/exampletenant.py b/xos/tosca/resources/exampletenant.py
index 2675189..1cb7b1f 100644
--- a/xos/tosca/resources/exampletenant.py
+++ b/xos/tosca/resources/exampletenant.py
@@ -1,5 +1,5 @@
from xosresource import XOSResource
-from core.models import Tenant, Service
+from core.models import Service
from services.exampleservice.models import ExampleTenant, SERVICE_NAME as EXAMPLETENANT_KIND
class XOSExampleTenant(XOSResource):
@@ -14,13 +14,13 @@
# ExampleTenant must always have a provider_service
provider_name = self.get_requirement("tosca.relationships.TenantOfService", throw_exception=True)
if provider_name:
- args["provider_service"] = self.get_xos_object(Service, throw_exception=True, name=provider_name)
+ args["owner"] = self.get_xos_object(Service, throw_exception=True, name=provider_name)
return args
def get_existing_objs(self):
args = self.get_xos_args(throw_exception=False)
- return ExampleTenant.objects.filter(provider_service=args["provider_service"], service_specific_id=args["service_specific_id"])
+ return ExampleTenant.objects.filter(owner=args["owner"], service_specific_id=args["service_specific_id"])
return []
def can_delete(self, obj):