xci: lib-install: Clear XCI_CACHE prior to downloading openstack-ansible-tests 15/55915/3
authorTaseer Ahmed <taseer94@gmail.com>
Tue, 17 Apr 2018 14:10:38 +0000 (19:10 +0500)
committerTaseer Ahmed <taseer94@gmail.com>
Thu, 19 Apr 2018 06:43:58 +0000 (11:43 +0500)
If we don't clear the cache, the script errors out with the following:
fatal: destination path '/root/releng-xci/.cache/repos/openstack-ansible-tests'
already exists and is not an empty directory

Change-Id: I22111ed655a4c6790f808155968deb2fd3828e41
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
xci/files/install-lib.sh

index 1a6c0b2..14acab1 100644 (file)
@@ -148,6 +148,9 @@ ansible_lint() {
     # Extract role from scenario information
     local testing_role=$(sed -n "/^- scenario: ${DEPLOY_SCENARIO}/,/^$/p" ${XCI_PATH}/xci/opnfv-scenario-requirements.yml | grep role | rev | cut -d '/' -f -1 | rev)
 
+    # clear XCI_CACHE
+    rm -rf ${XCI_CACHE}/repos/openstack-ansible-tests
+
     # Clone OSA rules too
     git clone --quiet --depth 1 https://github.com/openstack/openstack-ansible-tests.git \
         ${XCI_CACHE}/repos/openstack-ansible-tests