CORD-1092: Fixed a generation issue
Change-Id: I8922f5b66c1c5c5dcaa87cc4a8592030d065a8b6
diff --git a/xos/genx/tool/lib.py b/xos/genx/tool/lib.py
index fd7631e..a9cff78 100644
--- a/xos/genx/tool/lib.py
+++ b/xos/genx/tool/lib.py
@@ -11,6 +11,9 @@
elif (content_type=='stripped' or content_type=='"stripped"'):
return 'StrippedCharField'
+def xproto_eval(arg):
+ return eval(arg)
+
def django_string_type(xptags):
if ('content_type' in xptags):
return django_content_type_string(xptags)
diff --git a/xos/genx/tool/xos2jinja.py b/xos/genx/tool/xos2jinja.py
index 09af05c..2804527 100644
--- a/xos/genx/tool/xos2jinja.py
+++ b/xos/genx/tool/xos2jinja.py
@@ -77,6 +77,7 @@
def visit_LinkDefinition(self, obj):
s={}
+
s['link_type'] = obj.link_type.pval
s['src_port'] = obj.src_port.value.pval
s['name'] = obj.src_port.value.pval
@@ -96,7 +97,8 @@
return True
def visit_FieldDefinition_post(self, obj):
- s={'_type':'field'}
+ s= {}
+
if isinstance(obj.ftype, m.Name):
s['type'] = obj.ftype.value
else:
@@ -112,6 +114,14 @@
opts[k] = v
s['options'] = opts
+ try:
+ last_link = self.stack[-1]['_type']
+ if (last_link=='link'):
+ s['link'] = True
+ except:
+ pass
+ s['_type'] = 'field'
+
self.stack.push(s)
return True
diff --git a/xos/genx/xprotos/core/tenantwithcontainer.xproto b/xos/genx/xprotos/core/tenantwithcontainer.xproto
index 78312d6..3c7b8e9 100644
--- a/xos/genx/xprotos/core/tenantwithcontainer.xproto
+++ b/xos/genx/xprotos/core/tenantwithcontainer.xproto
@@ -1,6 +1,6 @@
-message TenantWithContainer {
+message TenantWithContainer(Tenant) {
optional string name = 1 [db_index = False, max_length = 200, null = True, content_type = "stripped", blank = True];
required string kind = 2 [default = "generic", max_length = 30, content_type = "stripped", blank = False, null = False, db_index = False];
required manytoone provider_service->Service:provided_tenants = 3 [db_index = True, null = False, blank = False];
@@ -12,8 +12,8 @@
optional string service_specific_id = 9 [db_index = False, max_length = 30, null = True, content_type = "stripped", blank = True];
optional string service_specific_attribute = 10 [db_index = False, null = True, blank = True];
required string connect_method = 11 [default = "na", choices = "(('public', 'Public'), ('private', 'Private'), ('private-unidirectional', 'Private Unidirectional'), ('na', 'Not Applicable'))", max_length = 30, blank = False, null = False, db_index = False];
- optional manytoone instance->Instance:+ = 12 [help_text = "Instance used by this Tenant", null = True, db_index = True, blank = True];
- optional manytoone creator->User:+ = 13 [help_text = "Creator of this Tenant", null = True, db_index = True, blank = True];
+ optional manytoone instance->Instance:_ = 12 [help_text = "Instance used by this Tenant", null = True, db_index = True, blank = True];
+ optional manytoone creator->User:_ = 13 [help_text = "Creator of this Tenant", null = True, db_index = True, blank = True];
optional string external_hostname = 14 [max_length = 30, content_type = "stripped", blank = True, help_text = "External host name", null = True, db_index = False];
optional string external_container = 15 [max_length = 30, content_type = "stripped", blank = True, help_text = "External host name", null = True, db_index = False];
}