Merge "Fix copying file before checking it exists in hot package."

This commit is contained in:
Jenkins 2016-09-30 05:22:35 +00:00 committed by Gerrit Code Review
commit 9928994ef7
1 changed files with 2 additions and 1 deletions

View File

@ -77,11 +77,12 @@ class HotPackage(package_base.PackageBase):
def _translate_class(self):
template_file = os.path.join(self._source_directory, 'template.yaml')
shutil.copy(template_file, self.get_resource(self.full_name))
if not os.path.isfile(template_file):
raise exceptions.PackageClassLoadError(
self.full_name, 'File with class definition not found')
shutil.copy(template_file, self.get_resource(self.full_name))
with open(template_file) as stream:
hot = yaml.safe_load(stream)
if 'resources' not in hot: