vmbuilder cannot find locale.tmpl

Bug #338339 reported by Duncan McGreggor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VMBuilder
Fix Released
Undecided
Unassigned

Bug Description

When attempting to build an image with ubuntu-vm-builder, I get the following error:

Traceback (most recent call last):
  File "/home/oubiwann/lab/Canonical/Landscape/team/bigkevmcd/vmbuilder/ubuntu-vm-builder", line 29, in <module>
    VMBuilder.run()
  File "/home/oubiwann/lab/Canonical/Landscape/team/bigkevmcd/vmbuilder/VMBuilder/__init__.py", line 66, in run
    frontend.run()
  File "/home/oubiwann/lab/Canonical/Landscape/team/bigkevmcd/vmbuilder/VMBuilder/plugins/cli/__init__.py", line 67, in run
    vm.create()
  File "/home/oubiwann/lab/Canonical/Landscape/team/bigkevmcd/vmbuilder/VMBuilder/vm.py", line 469, in create
    raise e
VMBuilder.exception.VMBuilderException: Template locale.tmpl not found in any of VMBuilder/plugins/ubuntu/templates, /home/oubiwann/.vmbuilder/ubuntu, /etc/vmbuilder/ubuntu
make: *** [build/appliance/appliance.qcow2] Error 1

However, examination of the first templates directory shows that VMBuilder does, in fact, have that template.

In a debugging session, the problem becomes apparent:

(Pdb) tmpl = 'VMBuilder/plugins/ubuntu/templates/locale.tmpl'
(Pdb) os.path.exists(tmpl)
False
(Pdb) os.path.exists('VMBuilder')
False
(Pdb) os.getcwd()
'/home/oubiwann/lab/Canonical/Landscape/team/oubiwann/standalone-builder'

In order for the template to be found in the VMBuilder templates dir, we need to supply an absolute path:

=== modified file 'VMBuilder/util.py'
--- VMBuilder/util.py 2008-11-27 17:25:29 +0000
+++ VMBuilder/util.py 2009-03-05 17:19:21 +0000
@@ -169,7 +169,7 @@
         searchList.append(context)
     searchList.append(vm)

- tmpldirs = ['VMBuilder/plugins/%s/templates',
+ tmpldirs = [os.path.dirname(__file__) + '/plugins/%s/templates',
                 os.path.expanduser('~/.vmbuilder/%s'),
                 '/etc/vmbuilder/%s']

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

I just attached a branch for this patch as well. Branch was made from trunk, r288.

Charles Hooper (chooper)
Changed in vmbuilder:
status: New → Confirmed
Soren Hansen (soren)
Changed in vmbuilder:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.