[dsl] Package type is not determined correctly while getting class by name

Bug #1532800 reported by Ekaterina Chernova
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
High
Stan Lagun
Liberty
Won't Fix
Medium
Stan Lagun
Mitaka
Fix Released
High
Stan Lagun

Bug Description

Load the following class:

Namespaces:
  =: io.murano.test
  sys: io.murano.system

Extends: TestFixture

Name: MyTest

Methods:
    initialize:
        Body:
            # Object model can be loaded from json file, or provided
            # directly in MuranoPL code as a yaml insertion.
            - $.appJson: new(sys:Resources).json('tomcat-for-mock.json')
            - $.heatOutput: new(sys:Resources).json('output.json')
            - $.log: logger('test')
            - $.agentCallCount: 0

    # Mock method, that returns predefined heat stack output
    getStackOut:
      Body:
        - $.log.info('Mocking heat stack')
        - Return: $.heatOutput

    testDeploy2:
      Body:
        - inject(sys:HeatStack, push, $this, getStackOut)
        - inject(sys:HeatStack, output, $this, getStackOut)

        # Mock is defined with YAQL function and it will print the original variable (agent template)
        - inject(sys:Agent, call, withOriginal(t => $template) -> $.log.info('{0}', $t))

        - $.env: $this.load($.appJson)
        - $.env.deploy()

        - print($.env.applications[0].getAttr(deployed, false, 'io.murano.apps.apache.Tomcat'))

So it is not possible to set owner for getAttr method.

This happened after this bug https://bugs.launchpad.net/murano/+bug/1529275 was fixed

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/268304
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=89527eaf864d3c7a4de82a93313850a651a0fef6
Submitter: Jenkins
Branch: master

commit 89527eaf864d3c7a4de82a93313850a651a0fef6
Author: Stan Lagun <email address hidden>
Date: Fri Jan 15 22:40:58 2016 +0300

    Broken owner parameter for getAttr/setAttr was fixed

    It was impossible to explicitly provide attribute owner class to
    getAttr/setAttr methods without using namespace prefix or if the
    type was not from the core library.

    The problem is a combination of 2 issues:
    * There was no yaql smart-type specification for the parameter.
       So the type passed as string remained to be string rather than
       MuranoClassReference.
    * MuranoTypeName smart-type used current type package to
        lookup MuranoClass instance by its name. Because getAttr/
        setAttr are located in core library it couldn't find types that
        are not in core library. To solve this now all python methods
        have special metadata key so that we could distinguish
        methods that run in new context from global yaql functions
        that use the same smart type but run in caller context. In former
        case (which is the case for getAttr/setAttr) it now uses caller
        type rather than the current (io.murano.Object in this case).

    Change-Id: Ie87deb06bde498a7930bc617da323491855466c5
    Closes-Bug: #1532800

Changed in murano:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/269154
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=3172f815acac5a3987cb2dc5aa4f8325ce9ef765
Submitter: Jenkins
Branch: master

commit 3172f815acac5a3987cb2dc5aa4f8325ce9ef765
Author: Stan Lagun <email address hidden>
Date: Mon Jan 18 18:48:46 2016 +0300

    Fixes attribute store for MuranoClassReference types

    When owner is passed to getAttr/setAttr it uis converted to
    MuranoClassReference instance. But object store expects
    only MuranoClass instances.

    This should have been a part of Ie87deb06bde498a7930bc617da323491855466c5
    commit. However it was merged too early.

    Change-Id: I40fcc778824421ce4638fd32b9290da0af2030fb
    Closes-Bug: #1532800

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/murano 2.0.0.0b3

This issue was fixed in the openstack/murano 2.0.0.0b3 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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