Explicit error if template.cfg is not found when copying it to instance

parent 252e20ad
...@@ -284,7 +284,12 @@ class Partition(object): ...@@ -284,7 +284,12 @@ class Partition(object):
template_location = os.path.join(self.software_path, 'template.cfg') template_location = os.path.join(self.software_path, 'template.cfg')
config_location = os.path.join(self.instance_path, 'buildout.cfg') config_location = os.path.join(self.instance_path, 'buildout.cfg')
self.logger.debug("Coping %r to %r" % (template_location, config_location)) self.logger.debug("Coping %r to %r" % (template_location, config_location))
try:
shutil.copy(template_location, config_location) shutil.copy(template_location, config_location)
except IOError, e:
# Template not found on SR, we notify user.
raise IOError('Software Release %s is not correctly installed.\n'
'%s' % e)
# fill generated buildout with additional information # fill generated buildout with additional information
buildout_text = open(config_location).read() buildout_text = open(config_location).read()
buildout_text += '\n\n' + pkg_resources.resource_string(__name__, buildout_text += '\n\n' + pkg_resources.resource_string(__name__,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment