From 44a79a8a6bed498d13ad783f66c36d172a9ea325 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Mon, 28 Jan 2019 14:49:42 +0200 Subject: [PATCH] Install ansible and openstacksdk inside virtualenv otherwise we get a conflict with python-ipaddress which is a dependency of python2-pip and can't really be removed! Installing from RPM is also a no-go b/c openstacksdk is not available in EPEL 7. OTOH the RDO repositories which OpenStack recommends have older version (0.11) and ansible wants 0.12 or later! Related: rhbz#1656105 --- tests/cli/test_build_and_deploy_openstack.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/cli/test_build_and_deploy_openstack.sh b/tests/cli/test_build_and_deploy_openstack.sh index cc39d24e..7f902e9d 100755 --- a/tests/cli/test_build_and_deploy_openstack.sh +++ b/tests/cli/test_build_and_deploy_openstack.sh @@ -10,6 +10,7 @@ . /usr/share/beakerlib/beakerlib.sh CLI="./src/bin/composer-cli" +VENV=`mktemp -d /tmp/ansible.venv.XXX` rlJournalStart @@ -35,13 +36,15 @@ rlJournalStart rlLogInfo "OS_PASSWORD is configured" fi - if ! rlCheckRpm "python2-pip"; then - rlRun -t -c "yum -y install python2-pip" - rlAssertRpm python2-pip - fi + rlRun -t -c "yum -y install python2-pip python-virtualenv" + rlAssertRpm python2-pip + rlAssertRpm python-virtualenv + rlRun -t -c "virtualenv $VENV" + + source $VENV/bin/activate rlRun -t -c "pip install --upgrade pip setuptools" - rlRun -t -c "pip install ansible openstacksdk 'dogpile.cache>=0.6.2,<0.7.0'" + rlRun -t -c "pip install ansible openstacksdk" rlPhaseEnd rlPhaseStartTest "compose start" @@ -128,7 +131,8 @@ __EOF__ rlRun -t -c "ansible localhost -m os_server -a 'name=$VM_NAME state=absent'" rlRun -t -c "ansible localhost -m os_image -a 'name=$OS_IMAGE_NAME state=absent'" rlRun -t -c "$CLI compose delete $UUID" - rlRun -t -c "rm -rf $IMAGE $SSH_KEY_DIR $TMP_DIR" + deactivate + rlRun -t -c "rm -rf $IMAGE $SSH_KEY_DIR $TMP_DIR $VENV" rlPhaseEnd rlJournalEnd