diff options
author | Gordon Chung <chungg@ca.ibm.com> | 2013-10-24 19:04:13 -0400 |
---|---|---|
committer | Gordon Chung <chungg@ca.ibm.com> | 2013-10-25 11:39:22 -0400 |
commit | 2e436ada18e5b6d37342ff7969b189d4827df45d (patch) | |
tree | ec89a381ab2884c5dcb5b63182cfc770f939fe3b /pycadf/reporterstep.py | |
parent | 52aa7818bba4c16229d9d2b402009a36d781ea5f (diff) | |
download | pycadf-2e436ada18e5b6d37342ff7969b189d4827df45d.tar.gz |
improve model validation
- add isset to check "real" attribute and not descriptor
- verify only id is set in shortform
- verify either resource or resourceId value is set, not both.
blueprint improve-validation
related-bug: #1242830
Change-Id: Ie9e3f26c5d30cd36e6013a1f0b77c8fe466cb3f7
Diffstat (limited to 'pycadf/reporterstep.py')
-rw-r--r-- | pycadf/reporterstep.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pycadf/reporterstep.py b/pycadf/reporterstep.py index 94c7d75..6cc03d6 100644 --- a/pycadf/reporterstep.py +++ b/pycadf/reporterstep.py @@ -68,7 +68,7 @@ class Reporterstep(cadftype.CADFAbstractType): # self validate this cadf:Reporterstep type against schema def is_valid(self): return ( - hasattr(self, REPORTERSTEP_KEYNAME_ROLE) and - (hasattr(self, REPORTERSTEP_KEYNAME_REPORTER) or - hasattr(self, REPORTERSTEP_KEYNAME_REPORTERID)) + self._isset(REPORTERSTEP_KEYNAME_ROLE) and + (self._isset(REPORTERSTEP_KEYNAME_REPORTER) ^ + self._isset(REPORTERSTEP_KEYNAME_REPORTERID)) ) |