1+ from esdl import esdl
2+
13from esdlvalidator .validation .functions import utils
24from esdlvalidator .validation .functions .function import FunctionFactory , FunctionCheck , FunctionDefinition , ArgDefinition , FunctionType , CheckResult
35
@@ -27,7 +29,10 @@ def execute(self):
2729 # Some esdl entity values have a default of undefined or none when not set
2830 include .extend (["undefined" , "none" ])
2931 value = self .value
30- msg = {"offending_asset" : self .value .id }
32+ if isinstance (value , esdl .Port ):
33+ msg = {"offending_asset" : self .value .eContainer ().id }
34+ else :
35+ msg = {"offending_asset" : self .value .id }
3136
3237 if hasProp :
3338 if not utils .has_attribute (value , prop ):
@@ -48,15 +53,15 @@ def execute(self):
4853 else :
4954 return CheckResult (False , result )
5055
51- return self .check_includes (include , prop , value , self .value )
56+ return self .check_includes (include , prop , value , self .value , msg )
5257
53- def check_includes (self , include , prop , value , originalValue ):
54- msg = {"offending_asset" : self .value .id }
58+ def check_includes (self , include , prop , value , originalValue , msg ):
59+ # msg = {"offending_asset": self.value.id}
5560 for includeValue in include :
5661 if isinstance (value , list ):
5762 ret = []
5863 for v in value :
59- ret .append (self .check_includes (include , prop , v , originalValue ))
64+ ret .append (self .check_includes (include , prop , v , originalValue , msg ))
6065 for r in ret :
6166 if not r .ok :
6267 return r
0 commit comments