diff --git a/murano/cmd/test_runner.py b/murano/cmd/test_runner.py index 41ea8d1a..511fad7a 100755 --- a/murano/cmd/test_runner.py +++ b/murano/cmd/test_runner.py @@ -72,14 +72,15 @@ class MuranoTestRunner(object): version_spec = helpers.parse_version_spec('*') package = pkg_loader.load_package(name, version_spec) except exceptions.NoPackageFound: - if not CONF.engine.load_packages_from: + if not CONF.packages_opts.load_packages_from: msg = _('Local package is not found since "load-packages-from"' ' engine parameter is not provided and specified ' 'packages is not loaded to murano-api') else: msg = _('Specified package is not found: {0} were scanned ' 'together with murano database' - ).format(','.join(CONF.engine.load_packages_from)) + ).format(','.join( + CONF.packages_opts.load_packages_from)) LOG.error(msg) self.error(msg, show_help=False) except exc.CommunicationError: @@ -211,7 +212,7 @@ class MuranoTestRunner(object): # Replace location of loading packages with provided from command line. if load_packages_from: - cfg.CONF.engine.load_packages_from = load_packages_from + cfg.CONF.packages_opts.load_packages_from = load_packages_from with package_loader.CombinedPackageLoader( murano_client_factory, client.tenant_id) as pkg_loader: engine.get_plugin_loader().register_in_loader(pkg_loader) diff --git a/murano/common/config.py b/murano/common/config.py index fd69ca93..2b71c07d 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -205,9 +205,6 @@ engine_opts = [ cfg.IntOpt('agent_timeout', default=3600, help=_('Time for waiting for a response from murano agent ' 'during the deployment')), - cfg.ListOpt('load_packages_from', default=[], - help=_('List of directories to load local packages from. ' - 'If not provided, packages will be loaded by API')) ] # TODO(sjmc7): move into engine opts? @@ -226,6 +223,10 @@ packages_opts = [ 'The packages would be re-used for consequent ' 'deployments.')), + cfg.ListOpt('load_packages_from', default=[], + help=_('List of directories to load local packages from. ' + 'If not provided, packages will be loaded only API')), + cfg.IntOpt('package_size_limit', default=5, help='Maximum application package size, Mb'), diff --git a/murano/engine/package_loader.py b/murano/engine/package_loader.py index be277c2f..70d0e6fd 100644 --- a/murano/engine/package_loader.py +++ b/murano/engine/package_loader.py @@ -452,7 +452,7 @@ class CombinedPackageLoader(package_loader.MuranoPackageLoader): murano_client_factory, tenant_id, root_loader) self.directory_loaders = [] - for folder in CONF.engine.load_packages_from: + for folder in CONF.packages_opts.load_packages_from: if os.path.exists(folder): self.directory_loaders.append(DirectoryPackageLoader( folder, root_loader)) diff --git a/murano/tests/unit/api/cmd/test_test_runner.py b/murano/tests/unit/api/cmd/test_test_runner.py index 7fe40aff..48dda4c9 100644 --- a/murano/tests/unit/api/cmd/test_test_runner.py +++ b/murano/tests/unit/api/cmd/test_test_runner.py @@ -49,7 +49,7 @@ class TestCaseShell(testtools.TestCase): dirs = [os.path.dirname(__file__), os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, 'meta')] - self.override_config('load_packages_from', dirs, 'engine') + self.override_config('load_packages_from', dirs, 'packages_opts') def tearDown(self): super(TestCaseShell, self).tearDown() diff --git a/murano/tests/unit/engine/test_package_loader.py b/murano/tests/unit/engine/test_package_loader.py index 8a82a7a8..35bc20ba 100644 --- a/murano/tests/unit/engine/test_package_loader.py +++ b/murano/tests/unit/engine/test_package_loader.py @@ -127,7 +127,7 @@ class TestCombinedPackageLoader(base.MuranoTestCase): super(TestCombinedPackageLoader, cls).setUpClass() location = os.path.dirname(__file__) - CONF.set_override('load_packages_from', [location], 'engine', + CONF.set_override('load_packages_from', [location], 'packages_opts', enforce_type=True) cls.murano_client_factory = mock.MagicMock() cls.loader = package_loader.CombinedPackageLoader(