use local cirros image in post-deploy script 55/30755/2
authorAlex Yang <yangyang1@zte.com.cn>
Fri, 17 Mar 2017 00:57:39 +0000 (08:57 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Mon, 20 Mar 2017 07:32:43 +0000 (15:32 +0800)
In daisy building job, cirros image is packed in daisy image file.
And it would be copied to /var/lib/daisy/images/ directory after daisy
installed. The post-deploy script can use it locally.

Change-Id: I45adbdd8b7c87b574367820076f6019638310ed8
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
deploy/post/execute.py

index b9665e1..288e949 100644 (file)
@@ -64,7 +64,7 @@ def _prepare_cirros():
     url = 'http://download.cirros-cloud.net'
     version = '0.3.5'
     name = 'cirros-{}-x86_64-disk.img'.format(version)
-    img = os.path.join(os.path.abspath(os.path.dirname(__file__)), name)
+    img = os.path.join("/var/lib/daisy/images", name)
     if not os.path.isfile(img):
         cmd = "wget %(url)s/%(version)s/%(name)s -O %(path)s" % {
             'url': url,