From 849f1adb1d0763955d1dfa1684065fa9e350e79d Mon Sep 17 00:00:00 2001
From: Xicheng Chang <xichengchang@huawei.com>
Date: Thu, 18 Jun 2015 15:36:06 -0700
Subject: [PATCH] Update ansible regtest

Pre-download centos65.box on host to save time.

Change-Id: I19bbc1257d687c89faef0cd9396d8e6f1b3a8385
---
 regtest/ansible/ci/prepare.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/regtest/ansible/ci/prepare.sh b/regtest/ansible/ci/prepare.sh
index 9f878126..cb247618 100644
--- a/regtest/ansible/ci/prepare.sh
+++ b/regtest/ansible/ci/prepare.sh
@@ -27,8 +27,12 @@ centos65_box_vb_filename=$(basename ${centos65_box_vb_url})
 #wget ${precise_box_vb_url}
 vagrant box list |grep centos65
 if [[ $? != 0 ]]; then
-    wget ${centos65_box_vb_url}
-    mv ${centos65_box_vb_filename} centos65.box
+    if [ -f "/opt/regtest/boxes/CentOS-6.5-x86_64-v20140504.box" ]; then
+        echo "centos65 box file found"
+        mv /opt/regtest/boxes/CentOS-6.5-x86_64-v20140504.box centos65.box
+    else
+        wget ${centos65_box_vb_url}
+        mv ${centos65_box_vb_filename} centos65.box
     vagrant mutate centos65.box libvirt
 else
     echo "centos65 box already exists"