set service to tag
diff --git a/xos/tosca/resources/tag.py b/xos/tosca/resources/tag.py
index 76d41cd..001cba8 100644
--- a/xos/tosca/resources/tag.py
+++ b/xos/tosca/resources/tag.py
@@ -6,7 +6,7 @@
from translator.toscalib.tosca_template import ToscaTemplate
from django.contrib.contenttypes.models import ContentType
-from core.models import Tag
+from core.models import Tag, Service
from xosresource import XOSResource
@@ -29,6 +29,10 @@
args["content_type"] = ContentType.objects.get_for_model(target_model)
args["object_id"] = target_model.id
+ service_name = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=throw_exception)
+ if service_name:
+ args["service"] = self.get_xos_object(Service, name=service_name)
+
# To uniquely identify a Tag, we must know the object that it is attached
# to as well as the name of the Tag.