get_operation_output translation is broken

Bug #1641734 reported by Sahdev Zala
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
Fix Released
High
Sahdev Zala

Bug Description

Heat-Translator currently handling get_operation_output function as a dictionary because get_operation_output support was not provided in the TOSCA-Parser when translation support was enabled. Recently TOSCA-Parser has added support to handle this function and as a result TOSCA-Parser now returns an object instead of a plain dictionary. This changes breaks non-voting TOSCA-Parser gate (gate-heat-translator-tox-py27-tp-ubuntu-xenial) in the heat-translator with following error.

2016-11-14 17:18:36.994294 | Traceback (most recent call last):
2016-11-14 17:18:36.994350 | File "translator/tests/test_tosca_hot_translation.py", line 496, in test_hot_exchange_public_ssh_key
2016-11-14 17:18:36.994394 | self._test_successful_translation(tosca_file, hot_file, params)
2016-11-14 17:18:36.994450 | File "translator/tests/test_tosca_hot_translation.py", line 36, in _test_successful_translation
2016-11-14 17:18:36.994489 | json.dumps(diff, indent=4, separators=(', ', ': ')))
2016-11-14 17:18:36.994578 | File "/home/jenkins/workspace/gate-heat-translator-tox-py27-tp-ubuntu-xenial/.tox/py27-tp/local/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
2016-11-14 17:18:36.994622 | self.assertThat(observed, matcher, message)
2016-11-14 17:18:36.994710 | File "/home/jenkins/workspace/gate-heat-translator-tox-py27-tp-ubuntu-xenial/.tox/py27-tp/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
2016-11-14 17:18:36.994743 | raise mismatch_error
2016-11-14 17:18:36.994777 | testtools.matchers._impl.MismatchError: !=:
2016-11-14 17:18:36.994798 | reference = {}
2016-11-14 17:18:36.994857 | actual = {'resources': {'generate_ssh_key_create_config': {'properties': {'outputs': {'<Expected>': None,
2016-11-14 17:18:36.994923 | '<Provided>': [{'name': 'public_key'}]}}},
2016-11-14 17:18:36.994988 | 'import_public_key_create_deploy': {'properties': {'input_values': {'public_key': {'<Expected>': None,
2016-11-14 17:18:37.735682 | '<Provided>': {'get_attr': ['generate_ssh_key_create_deploy',
2016-11-14 17:18:37.735768 | 'public_key']}}}}}}}
2016-11-14 17:18:37.735787 | : <difference> : {
2016-11-14 17:18:37.735798 | "resources": {
2016-11-14 17:18:37.735813 | "generate_ssh_key_create_config": {
2016-11-14 17:18:37.735824 | "properties": {
2016-11-14 17:18:37.735837 | "outputs": {
2016-11-14 17:18:37.735851 | "<Expected>": null,
2016-11-14 17:18:37.735865 | "<Provided>": [
2016-11-14 17:18:37.735876 | {
2016-11-14 17:18:37.735892 | "name": "public_key"
2016-11-14 17:18:37.735903 | }
2016-11-14 17:18:37.735912 | ]
2016-11-14 17:18:37.735922 | }
2016-11-14 17:18:37.735930 | }
2016-11-14 17:18:37.735950 | },
2016-11-14 17:18:37.735964 | "import_public_key_create_deploy": {
2016-11-14 17:18:37.735975 | "properties": {
2016-11-14 17:18:37.735988 | "input_values": {
2016-11-14 17:18:37.736000 | "public_key": {
2016-11-14 17:18:37.736014 | "<Expected>": null,
2016-11-14 17:18:37.736028 | "<Provided>": {
2016-11-14 17:18:37.736042 | "get_attr": [
2016-11-14 17:18:37.736061 | "generate_ssh_key_create_deploy",
2016-11-14 17:18:37.736076 | "public_key"
2016-11-14 17:18:37.736087 | ]
2016-11-14 17:18:37.736097 | }
2016-11-14 17:18:37.736107 | }
2016-11-14 17:18:37.736115 | }
2016-11-14 17:18:37.736123 | }
2016-11-14 17:18:37.736130 | }
2016-11-14 17:18:37.736137 | }
2016-11-14 17:18:37.736142 | }
2016-11-14 17:18:37.736152 | Ran 152 tests in 1.092s
2016-11-14 17:18:37.736162 | FAILED (id=0, failures=1)
2016-11-14 17:18:37.736173 | error: testr failed (1)

When a tosca-parser new release (0.7.0) will be created, it will break heat-translator tests. The fix is to use GetOperationOutput but it can't be applied to heat-translator until release of tosca-parser.

The temporary solution is to comment the above test, and add it back after newer release of tosca-parser with proper fix in the heat-translator.

All the changes will be done under the same bug!

Sahdev Zala (spzala)
Changed in heat-translator:
assignee: nobody → Sahdev Zala (spzala)
importance: Undecided → Medium
importance: Medium → High
Sahdev Zala (spzala)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat-translator (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/397383

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat-translator (master)

Reviewed: https://review.openstack.org/397383
Committed: https://git.openstack.org/cgit/openstack/heat-translator/commit/?id=559815166551456f2e491505956fd1802fd821b9
Submitter: Jenkins
Branch: master

commit 559815166551456f2e491505956fd1802fd821b9
Author: sahdev zala <email address hidden>
Date: Mon Nov 14 16:39:24 2016 -0500

    Fix tosca-parser non-voting gate

    Fix the gate-heat-translator-tox-py27-tp-ubuntu-xenial with
    this temporarily changes. Permanent changes are going to be added
    in a separate patch under the same bug and enabled after release
    of tosca-parser 0.7.0.

    Change-Id: Ie7e9ff76bcbe56b804db06a0561d1a19a022375a
    Related-Bug: 1641734

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat-translator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/420129

Changed in heat-translator:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-translator (master)

Reviewed: https://review.openstack.org/420129
Committed: https://git.openstack.org/cgit/openstack/heat-translator/commit/?id=5e5513f7e5384bf009258a6420b220458a3e9a72
Submitter: Jenkins
Branch: master

commit 5e5513f7e5384bf009258a6420b220458a3e9a72
Author: sahdev zala <email address hidden>
Date: Fri Jan 13 13:46:50 2017 -0500

    Fix get_operation_output function translation

    Fix the bug as tosca parser 0.7.0 is now released.

    Change-Id: I5ff787a8e537d28cc4b9db1ad78d29d67fed85fd
    Closes-Bug: #1641734

Changed in heat-translator:
status: In Progress → Fix Released
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.