Merge "Prevent logging of result of resources.string() method call"

This commit is contained in:
Jenkins 2016-09-14 20:19:57 +00:00 committed by Gerrit Code Review
commit 62f1a0fcf2
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import yaml as yamllib
from yaql.language import specs
from yaql.language import yaqltypes
from murano.dsl import constants
from murano.dsl import dsl
from murano.dsl import dsl_types
from murano.dsl import helpers
@ -52,6 +53,7 @@ class ResourceManager(object):
@staticmethod
@specs.parameter('owner', dsl.MuranoTypeParameter(nullable=True))
@specs.inject('receiver', yaqltypes.Receiver())
@specs.meta(constants.META_NO_TRACE, True)
def string(receiver, name, owner=None, binary=False):
path = ResourceManager._get_package(owner, receiver).get_resource(name)
mode = 'rb' if binary else 'rU'
@ -61,12 +63,14 @@ class ResourceManager(object):
@classmethod
@specs.parameter('owner', dsl.MuranoTypeParameter(nullable=True))
@specs.inject('receiver', yaqltypes.Receiver())
@specs.meta(constants.META_NO_TRACE, True)
def json(cls, receiver, name, owner=None):
return jsonlib.loads(cls.string(receiver, name, owner))
@classmethod
@specs.parameter('owner', dsl.MuranoTypeParameter(nullable=True))
@specs.inject('receiver', yaqltypes.Receiver())
@specs.meta(constants.META_NO_TRACE, True)
def yaml(cls, receiver, name, owner=None):
return yamllib.load(
cls.string(receiver, name, owner), Loader=yaml_loader)

View File

@ -0,0 +1,5 @@
---
fixes:
- Murano engine no longer logs methods ``string()``, ``json()``, and ``yaml()``
of the 'io.murano.system.Resources' class. This is done to prevent UnicodeDecodeError's
when transferring binary files to murano agent.