[ci] Unblock CI

* Remove listing nova agents from osresources. This API is not available
  anymore
* move tox installation from pre playbook to a role

Change-Id: Ic51f5c82e4ca89b997e2eb1d3d919661061c851f
This commit is contained in:
Andrey Kurilin 2021-02-03 22:15:50 +02:00
parent e7d8cb33a4
commit 29c368f989
5 changed files with 59 additions and 68 deletions

View File

@ -20,5 +20,4 @@
devstack_localrc:
USE_PYTHON3: true
tox_env: "functional"
pre-run: tests/ci/playbooks/tox-install.yaml
run: tests/ci/playbooks/tox-functional-env-run.yaml

View File

@ -169,9 +169,6 @@ class Nova(ResourceManager):
def list_hypervisors(self):
return self.client.hypervisors.list()
def list_agents(self):
return self.client.agents.list()
def list_keypairs(self):
return self.client.keypairs.list()

View File

@ -0,0 +1,58 @@
- name: Check required version of Python
args:
chdir: "{{ zuul.project.src_dir }}"
shell:
executable: /bin/sh
cmd: |
set -e
iniget(){
local xtrace
xtrace=$(set +o | grep xtrace)
set +o xtrace
local section=$1
local file="tox.ini"
local option="basepython"
local line
line=$(sed -ne "/^\[$section\]/,/^\[.*\]/ { /^$option[ \t]*=/ p; }" "$file")
echo ${line#*= python}
$xtrace
}
tox_testenv_python=$(iniget 'testenv:{{ tox_env }}')
if [ "$tox_testenv_python" != "" ]; then
echo $tox_testenv_python
else
echo $(iniget 'testenv')
fi
register: python_version
- name: Install the proper python version
become: True
become_user: root
shell:
executable: /bin/sh
cmd: |
set -e
apt-get update
apt-get install python{{ python_version.stdout }}-dev --yes
- name: Install the proper python pip version
become: True
become_user: root
shell:
executable: /bin/bash
cmd: |
set -e
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python{{ python_version.stdout }} get-pip.py
- name: Install python tox
become: True
become_user: root
shell:
executable: /bin/bash
cmd: |
pip{{ python_version.stdout }} install tox

View File

@ -11,5 +11,6 @@
# pass a check at 'prepare-for-rally-task' role.
rally_task: "rally-jobs/simple-job.yaml"
roles:
- tox-install
- prepare-for-rally-task
- tox-run

View File

@ -1,64 +0,0 @@
- hosts: all
name: Installs all required packages
tasks:
- name: Check required version of Python
args:
chdir: "{{ zuul.project.src_dir }}"
shell:
executable: /bin/sh
cmd: |
set -e
iniget(){
local xtrace
xtrace=$(set +o | grep xtrace)
set +o xtrace
local section=$1
local file="tox.ini"
local option="basepython"
local line
line=$(sed -ne "/^\[$section\]/,/^\[.*\]/ { /^$option[ \t]*=/ p; }" "$file")
echo ${line#*= python}
$xtrace
}
tox_testenv_python=$(iniget 'testenv:{{ tox_env }}')
if [ "$tox_testenv_python" != "" ]; then
echo $tox_testenv_python
else
echo $(iniget 'testenv')
fi
register: python_version
- name: Install the proper python version
become: True
become_user: root
shell:
executable: /bin/sh
cmd: |
set -e
apt-get update
apt-get install python{{ python_version.stdout }}-dev --yes
- name: Install the proper python pip version
become: True
become_user: root
shell:
executable: /bin/bash
cmd: |
set -e
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python{{ python_version.stdout }} get-pip.py
- name: Install python tox
become: True
become_user: root
shell:
executable: /bin/bash
cmd: |
pip{{ python_version.stdout }} install tox
roles:
- bindep