From 4bee1fa0dd01ed4f24589c2b1be720f2855e39e3 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Apr 29 2015 15:19:00 +0000 Subject: builder: avoid 'template' name collision Also fix a bug when accessing one of the variables. --- diff --git a/vmbuilder/builder.py b/vmbuilder/builder.py index 06142fe..529327b 100644 --- a/vmbuilder/builder.py +++ b/vmbuilder/builder.py @@ -11,7 +11,7 @@ import sys import os import tempfile -from vmbuilder import template +import vmbuilder.template from vmbuilder import exc from vmbuilder.logger import log from vmbuilder import shell @@ -57,7 +57,7 @@ class Builder(object): :raise TemplateError: if there is a problem with the template ''' - templ = template.Template(filepath=self.template_path) + templ = vmbuilder.template.Template(filepath=self.template_path) templ.load() self.template = templ.template @@ -112,7 +112,7 @@ class Builder(object): self.template['name'], self.outfile) else: msg = ("Failed to create a VM image of '%s'. Please review " - "virt-builder output." % template['name']) + "virt-builder output." % self.template['name']) log.critical(msg) raise exc.BuildError(msg, output=''.join(output))