deb-murano/murano/dsl/constants.py
Stan Lagun 89527eaf86 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
2016-01-15 23:13:17 +03:00

51 lines
1.7 KiB
Python

# Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import semantic_version
EXPRESSION_MEMORY_QUOTA = 512 * 1024
ITERATORS_LIMIT = 2000
CTX_ACTIONS_ONLY = '?actionsOnly'
CTX_ALLOW_PROPERTY_WRITES = '$?allowPropertyWrites'
CTX_ARGUMENT_OWNER = '$?argumentOwner'
CTX_ATTRIBUTE_STORE = '$?attributeStore'
CTX_CALLER_CONTEXT = '$?callerContext'
CTX_CURRENT_INSTRUCTION = '$?currentInstruction'
CTX_CURRENT_EXCEPTION = '$?currentException'
CTX_CURRENT_METHOD = '$?currentMethod'
CTX_ENVIRONMENT = '$?environment'
CTX_EXECUTOR = '$?executor'
CTX_PACKAGE_LOADER = '$?packageLoader'
CTX_SKIP_FRAME = '$?skipFrame'
CTX_THIS = '$?this'
CTX_TYPE = '$?type'
CTX_VARIABLE_SCOPE = '$?variableScope'
CTX_YAQL_ENGINE = '$?yaqlEngine'
CTX_ORIGINAL_CONTEXT = '$?originalContext'
DM_OBJECTS = 'Objects'
DM_OBJECTS_COPY = 'ObjectsCopy'
DM_ATTRIBUTES = 'Attributes'
META_MURANO_METHOD = '?muranoMethod'
META_NO_TRACE = '?noTrace'
CORE_LIBRARY = 'io.murano'
CORE_LIBRARY_OBJECT = 'io.murano.Object'
RUNTIME_VERSION_1_0 = semantic_version.Version('1.0.0')
RUNTIME_VERSION_1_1 = semantic_version.Version('1.1.0')
RUNTIME_VERSION_1_2 = semantic_version.Version('1.2.0')