CORD-1392: Autogenerate security policies
Change-Id: Ia183f2a84b27923802e62435c82b20b50fb3fcee
diff --git a/lib/xos-genx/xosgenx/xos2jinja.py b/lib/xos-genx/xosgenx/xos2jinja.py
index c58260e..edd80ef 100644
--- a/lib/xos-genx/xosgenx/xos2jinja.py
+++ b/lib/xos-genx/xosgenx/xos2jinja.py
@@ -124,6 +124,16 @@
return True
+ def visit_PolicyDefinition(self, obj):
+ if self.package:
+ pname = '.'.join([self.package, obj.name.value.pval])
+ else:
+ pname = obj.name.value.pval
+
+ self.policies[pname] = obj.body
+
+ return True
+
def visit_PackageStatement(self, obj):
dotlist = obj.name.value
dotlist2 = [f.pval for f in dotlist]