Use six to correctly handle text in Python 2 and 3 in the Role schema
Change-Id: I23a7dab693ff39377ee1e012aec106bc5b7aed0e Closes-Bug: #1700924
This commit is contained in:
parent
5a6423b7d7
commit
fbf557d13c
@ -17,7 +17,9 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
import six
|
||||||
from six.moves import cStringIO as StringIO
|
from six.moves import cStringIO as StringIO
|
||||||
|
|
||||||
from tripleo_common.exception import NotFound
|
from tripleo_common.exception import NotFound
|
||||||
from tripleo_common.exception import RoleMetadataError
|
from tripleo_common.exception import RoleMetadataError
|
||||||
|
|
||||||
@ -99,15 +101,15 @@ def validate_role_yaml(role_data=None, role_path=None):
|
|||||||
raise RoleMetadataError('Unable to parse role yaml')
|
raise RoleMetadataError('Unable to parse role yaml')
|
||||||
|
|
||||||
schema = {
|
schema = {
|
||||||
'name': {'type': str},
|
'name': {'type': six.string_types},
|
||||||
'CountDefault': {'type': int},
|
'CountDefault': {'type': int},
|
||||||
'HostnameFormatDefault': {'type': str},
|
'HostnameFormatDefault': {'type': six.string_types},
|
||||||
'disable_constraints': {'type': bool},
|
'disable_constraints': {'type': bool},
|
||||||
'disable_upgrade_deployment': {'type': bool},
|
'disable_upgrade_deployment': {'type': bool},
|
||||||
'upgrade_batch_size': {'type': int},
|
'upgrade_batch_size': {'type': int},
|
||||||
'ServicesDefault': {'type': list},
|
'ServicesDefault': {'type': list},
|
||||||
'tags': {'type': list},
|
'tags': {'type': list},
|
||||||
'description': {'type': str},
|
'description': {'type': six.string_types},
|
||||||
'networks': {'type': list},
|
'networks': {'type': list},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user