diff --git a/murano/engine/system/resource_manager.py b/murano/engine/system/resource_manager.py index 47f04609..b956151b 100644 --- a/murano/engine/system/resource_manager.py +++ b/murano/engine/system/resource_manager.py @@ -16,6 +16,7 @@ import json as jsonlib import yaml as yamllib +import murano.dsl.helpers as helpers import murano.dsl.murano_object as murano_object if hasattr(yamllib, 'CSafeLoader'): @@ -44,10 +45,9 @@ yaml_loader.add_constructor(u'tag:yaml.org,2002:timestamp', class ResourceManager(murano_object.MuranoObject): - def initialize(self, package_loader, _context, _class): - if _class is None: - _class = _context.get_data('$') - self._package = package_loader.get_package(_class.type.package.name) + def initialize(self, package_loader, _context): + murano_class = helpers.get_type(_context) + self._package = package_loader.get_package(murano_class.package.name) def string(self, name): path = self._package.get_resource(name) diff --git a/murano/engine/system/system_objects.py b/murano/engine/system/system_objects.py index a6a2e679..a81a3f31 100644 --- a/murano/engine/system/system_objects.py +++ b/murano/engine/system/system_objects.py @@ -41,9 +41,9 @@ def register(class_loader, package_loader): @murano_class.classname('io.murano.system.Resources') class ResourceManagerWrapper(resource_manager.ResourceManager): - def initialize(self, _context, _class=None): + def initialize(self, _context): super(ResourceManagerWrapper, self).initialize( - package_loader, _context, _class) + package_loader, _context) class_loader.import_class(agent.Agent) class_loader.import_class(agent_listener.AgentListener)