diff --git a/unit_tests/test_zaza_charm_lifecycle_deploy.py b/unit_tests/test_zaza_charm_lifecycle_deploy.py index 08d177f..3e53469 100644 --- a/unit_tests/test_zaza_charm_lifecycle_deploy.py +++ b/unit_tests/test_zaza_charm_lifecycle_deploy.py @@ -133,6 +133,9 @@ class TestCharmLifecycleDeploy(ut_utils.BaseTestCase): self.assertIsNone(lc_deploy.render_overlay('mybundle.yaml', '/tmp/')) def test_render_local_overlay(self): + self.patch_object(lc_deploy.utils, 'get_charm_config') + self.get_charm_config.return_value = { + 'charm_name': 'mycharm'} self.patch_object(lc_deploy.jinja2, 'Environment') self.patch_object(lc_deploy, 'get_template', return_value='atemplate') self.patch_object(lc_deploy, 'render_template') @@ -147,6 +150,9 @@ class TestCharmLifecycleDeploy(ut_utils.BaseTestCase): def test_render_local_overlay_default(self): jenv_mock = mock.MagicMock() jenv_mock.from_string.return_value = 'atemplate' + self.patch_object(lc_deploy.utils, 'get_charm_config') + self.get_charm_config.return_value = { + 'charm_name': 'mycharm'} self.patch_object(lc_deploy.jinja2, 'Environment', return_value=jenv_mock) self.patch_object(lc_deploy, 'get_template', return_value=None) diff --git a/zaza/charm_lifecycle/deploy.py b/zaza/charm_lifecycle/deploy.py index a325d5d..9047a20 100755 --- a/zaza/charm_lifecycle/deploy.py +++ b/zaza/charm_lifecycle/deploy.py @@ -196,7 +196,7 @@ def render_local_overlay(target_dir): rendered_template_file = os.path.join( target_dir, os.path.basename(LOCAL_OVERLAY_TEMPLATE_NAME)) - if utils.get_charm_config().get('charm-name', None): + if utils.get_charm_config().get('charm_name', None): render_template(template, rendered_template_file) return rendered_template_file