Merge "Validate attributes schema"

This commit is contained in:
Zuul 2019-04-02 09:29:25 +00:00 committed by Gerrit Code Review
commit 5bafd120bf
2 changed files with 11 additions and 5 deletions

View File

@ -48,19 +48,19 @@ class Schema(constr.Schema):
) )
TYPES = ( TYPES = (
STRING, MAP, LIST, INTEGER, BOOLEAN UNKNOWN, STRING, MAP, LIST, INTEGER, BOOLEAN
) = ( ) = (
'String', 'Map', 'List', 'Integer', 'Boolean' None, 'String', 'Map', 'List', 'Integer', 'Boolean'
) )
def __init__(self, description=None, def __init__(self, description=None,
support_status=support.SupportStatus(), support_status=support.SupportStatus(),
cache_mode=CACHE_LOCAL, cache_mode=CACHE_LOCAL,
type=None): type=UNKNOWN):
self.description = description super(Schema, self).__init__(type, description)
self.support_status = support_status self.support_status = support_status
self.cache_mode = cache_mode self.cache_mode = cache_mode
self.type = type self.validate()
def __getitem__(self, key): def __getitem__(self, key):
if key == self.DESCRIPTION: if key == self.DESCRIPTION:

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
When loading a Resource plugin, the attribute schema is now validated in
the same way that the properties schema is. Third-party resource plugins
should be tested to check that they still comply.