Tripleo-common roles tests fails locally but not on CI

Bug #1700924 reported by Adriano Petrich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Adriano Petrich

Bug Description

Running tox locally with expected type being str but the code is using unicode

$ tox -e py27

Traceback (most recent call last):
  File "tripleo_common/tests/utils/test_roles.py", line 98, in test_validate_role_yaml
    role = rolesutils.validate_role_yaml(SAMPLE_ROLE)
  File "tripleo_common/utils/roles.py", line 122, in validate_role_yaml
    raise RoleMetadataError(msg)
tripleo_common.exception.RoleMetadataError: Role 'sample': HostnameFormatDefault is not of expected type <type 'str'>
======================================================================
FAIL: tripleo_common.tests.utils.test_roles.TestRolesUtils.test_validate_role_yaml_with_file
tags: worker-2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tripleo_common/tests/utils/test_roles.py", line 104, in test_validate_role_yaml_with_file
    r = rolesutils.validate_role_yaml(role_path='/foo.yaml')
  File "tripleo_common/utils/roles.py", line 122, in validate_role_yaml
    raise RoleMetadataError(msg)
tripleo_common.exception.RoleMetadataError: Role 'sample': HostnameFormatDefault is not of expected type <type 'str'>
======================================================================
FAIL: tripleo_common.tests.utils.test_roles.TestRolesUtils.test_generate_roles_data_from_directory
tags: worker-3
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/frac/Code/tripleo-common/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "tripleo_common/tests/utils/test_roles.py", line 84, in test_generate_roles_data_from_directory
    ['foo', 'bar'])
  File "tripleo_common/utils/roles.py", line 74, in generate_roles_data_from_directory
    validate_role_yaml(role_path=file_path)
  File "tripleo_common/utils/roles.py", line 122, in validate_role_yaml
    raise RoleMetadataError(msg)
tripleo_common.exception.RoleMetadataError: Role 'sample': HostnameFormatDefault is not of expected type <type 'str'>

Changed in tripleo:
assignee: nobody → Adriano Petrich (apetrich)
Changed in tripleo:
status: New → In Progress
Changed in tripleo:
milestone: none → pike-3
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/476896
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=fbf557d13c8d2d4060574eef3a4d2fbe84f4a1ce
Submitter: Jenkins
Branch: master

commit fbf557d13c8d2d4060574eef3a4d2fbe84f4a1ce
Author: Dougal Matthews <email address hidden>
Date: Fri Jun 23 12:44:04 2017 +0100

    Use six to correctly handle text in Python 2 and 3 in the Role schema

    Change-Id: I23a7dab693ff39377ee1e012aec106bc5b7aed0e
    Closes-Bug: #1700924

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 7.4.0

This issue was fixed in the openstack/tripleo-common 7.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.