diff --git a/compass/deployment/installers/os_installers/cobbler/cobbler.py b/compass/deployment/installers/os_installers/cobbler/cobbler.py index 0fab5edd..5ae589ae 100644 --- a/compass/deployment/installers/os_installers/cobbler/cobbler.py +++ b/compass/deployment/installers/os_installers/cobbler/cobbler.py @@ -222,6 +222,11 @@ class CobblerInstaller(OSInstaller): tmpl_path = os.path.join( os.path.join(self.tmpl_dir, os_version), self.SYS_TMPL_NAME ) + if not os.path.exists(tmpl_path): + err_msg = "Template '%s' does not exists!" % self.SYS_TMPL_NAME + logging.error(err_msg) + raise Exception(err_msg) + system_config = self.get_config_from_template(tmpl_path, host_vars_dict) diff --git a/compass/deployment/installers/pk_installers/chef_installer/chef_installer.py b/compass/deployment/installers/pk_installers/chef_installer/chef_installer.py index cd04ae04..534dc2bb 100644 --- a/compass/deployment/installers/pk_installers/chef_installer/chef_installer.py +++ b/compass/deployment/installers/pk_installers/chef_installer/chef_installer.py @@ -246,6 +246,10 @@ class ChefInstaller(PKInstaller): env_tmpl_path = os.path.join( os.path.join(self.tmpl_dir, self.ENV_TMPL_DIR), tmpl_name ) + if not os.path.exists(env_tmpl_path): + logging.error("Environment template '%s' doesn't exist", tmpl_name) + raise Exception("Template '%s' does not exist!" % tmpl_name) + logging.debug("generating env from template %s", env_tmpl_path) return self.get_config_from_template(env_tmpl_path, global_vars_dict)