From ab781389309a2570ee4497935332ceed5dc8312f Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 2 Oct 2013 18:13:44 +0300 Subject: [PATCH] Converted VM_CPUS and VM_MEMORY to int When VM_CPUS and VM_MEMORY are taken from configuration file they have to be converted to int to avoid this traceback: Traceback (most recent call last): File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 142, in sys.exit(main()) File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 94, in main os.getenv("VM_CPUS", 8), basedir) File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 33, in run_inside_vm (vm_memory, vm_cpus, vm_image, basedir) TypeError: %d format: a number is required, not str Change-Id: Ib18cbd320f013e8b3d9075dadf22840131e07bc1 Signed-off-by: Ed Bartosh --- job_imager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/job_imager.py b/job_imager.py index 465cb47..6673def 100755 --- a/job_imager.py +++ b/job_imager.py @@ -90,8 +90,8 @@ def main(): print 'starting mic inside VM to create image' sys.stdout.flush() - ret = run_inside_vm(vm_image, os.getenv("VM_MEMORY", 8192), - os.getenv("VM_CPUS", 8), basedir) + ret = run_inside_vm(vm_image, int(os.getenv("VM_MEMORY", 8192)), + int(os.getenv("VM_CPUS", 8)), basedir) # workaround for qemu/9p bug in mapping permissions set_permissions(outdir, (0644, 0755)) else: -- 2.7.4