From d97c70768d15571872233922caf17c4a4c34065b Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Wed, 7 Jul 2021 16:00:54 -0700 Subject: [PATCH] Update to python3 Signed-off-by: Todd Malsbary Change-Id: Ib85b95e48cc1ce4d64cf54b8a6e82c8cd810c3c5 --- ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml | 4 ++-- deploy/metal3-vm/ubuntu_install_requirements.sh | 11 +++-------- .../vm-setup/roles/libvirt/defaults/main.yml | 4 ++-- env/cd_package_installer.sh | 9 ++++++--- env/metal3/01_install_package.sh | 19 +++++++++++-------- .../bootloader-env/01_bootloader_package_req.sh | 13 ++++++++----- .../bootloader-env/02_clean_bootloader_package_req.sh | 14 +++++++++----- 7 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml b/ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml index e19173e..5e37181 100644 --- a/ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml +++ b/ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml @@ -53,9 +53,9 @@ failed_when: "'Result: success\n' != result.output" tags: [gerrit] -- name: Install python-pip +- name: Install python3-pip apt: - name: python-pip + name: python3-pip tags: [jobs] - name: Install python-jenkins and lxml(required by jenkins_job module) diff --git a/deploy/metal3-vm/ubuntu_install_requirements.sh b/deploy/metal3-vm/ubuntu_install_requirements.sh index fc1974d..5559c63 100755 --- a/deploy/metal3-vm/ubuntu_install_requirements.sh +++ b/deploy/metal3-vm/ubuntu_install_requirements.sh @@ -42,10 +42,11 @@ sudo apt -y install \ nmap \ patch \ psmisc \ - python-pip \ + python3-pip \ wget - +sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 +sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 # Install pyenv @@ -70,9 +71,6 @@ if [[ $PATH != *pyenv* ]]; then fi fi -pyenv install -s 2.7.18 -pyenv versions -pyenv global 2.7.18 # There are some packages which are newer in the tripleo repos # Setup yarn and nodejs repositories @@ -98,10 +96,7 @@ sudo apt -y install \ nodejs \ qemu-kvm \ libvirt-bin libvirt-clients libvirt-dev \ - python-ironicclient \ - python-ironic-inspector-client \ golang-go \ - python-lxml \ unzip \ yarn \ genisoimage diff --git a/deploy/metal3-vm/vm-setup/roles/libvirt/defaults/main.yml b/deploy/metal3-vm/vm-setup/roles/libvirt/defaults/main.yml index 1dc5f3b..3e477b0 100644 --- a/deploy/metal3-vm/vm-setup/roles/libvirt/defaults/main.yml +++ b/deploy/metal3-vm/vm-setup/roles/libvirt/defaults/main.yml @@ -50,9 +50,9 @@ ubuntu_libvirt_packages: - libvirt-bin - libvirt-clients - libvirt-dev - - python-libvirt + - python3-libvirt - libguestfs-tools - - python-lxml + - python3-lxml - gir1.2-polkit-1.0 - libpolkit-agent-1-0 - libpolkit-backend-1-0 diff --git a/env/cd_package_installer.sh b/env/cd_package_installer.sh index e6641d6..abf8429 100755 --- a/env/cd_package_installer.sh +++ b/env/cd_package_installer.sh @@ -17,14 +17,17 @@ function install_essential_packages { nmap \ patch \ psmisc \ - python-pip \ - python-requests \ - python-setuptools \ + python3-pip \ + python3-requests \ + python3-setuptools \ vim \ wget \ git \ software-properties-common + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 + add-apt-repository -y ppa:longsleep/golang-backports apt-get update apt-get install -y golang-go diff --git a/env/metal3/01_install_package.sh b/env/metal3/01_install_package.sh index 485fd18..4d4be9f 100755 --- a/env/metal3/01_install_package.sh +++ b/env/metal3/01_install_package.sh @@ -21,15 +21,18 @@ function install_essential_packages { nmap \ patch \ psmisc \ - python-pip \ - python-requests \ - python-setuptools \ + python3-pip \ + python3-requests \ + python3-setuptools \ vim \ wget \ git \ software-properties-common \ bridge-utils + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 + add-apt-repository -y ppa:longsleep/golang-backports apt-get update apt-get install golang-go -y @@ -40,11 +43,11 @@ function install_ironic_packages { apt-get -y install \ jq \ nodejs \ - python-ironicclient \ - python-ironic-inspector-client \ - python-lxml \ - python-netaddr \ - python-openstackclient \ + python3-ironicclient \ + python3-ironic-inspector-client \ + python3-lxml \ + python3-netaddr \ + python3-openstackclient \ unzip \ genisoimage \ whois diff --git a/env/ubuntu/bootloader-env/01_bootloader_package_req.sh b/env/ubuntu/bootloader-env/01_bootloader_package_req.sh index da4165d..737285d 100755 --- a/env/ubuntu/bootloader-env/01_bootloader_package_req.sh +++ b/env/ubuntu/bootloader-env/01_bootloader_package_req.sh @@ -18,9 +18,11 @@ fi function download_essential_packages { apt-get update for package in crudini curl dnsmasq figlet golang nmap patch psmisc \ - python-pip python-requests python-setuptools vim wget; do + python3-pip python3-requests python3-setuptools vim wget; do apt-get -d install $package -y done + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 } function build_baremetal_operator_images { @@ -137,8 +139,9 @@ function download_build_packages { function check_pip { if ! which pip ; then - apt-get install python-pip -y + apt-get install python3-pip -y fi + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 } function check_curl { @@ -154,9 +157,9 @@ function check_apt_tools { } function download_ironic_packages { - for package in jq nodejs python-ironicclient \ - python-ironic-inspector-client python-lxml python-netaddr \ - python-openstackclient unzip genisoimage; do + for package in jq nodejs python3-ironicclient \ + python3-ironic-inspector-client python3-lxml python3-netaddr \ + python3-openstackclient unzip genisoimage; do apt-get -d install $package -y done diff --git a/env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh b/env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh index 54c9ab3..1f6c474 100755 --- a/env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh +++ b/env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh @@ -17,17 +17,21 @@ function autoremove { function clean_essential_packages { apt-get update for package in crudini curl dnsmasq figlet golang nmap patch psmisc \ - python-pip python-requests python-setuptools vim wget; do + python3-pip python3-requests python3-setuptools vim wget; do apt-get remove $package -y done + update-alternatives --remove python /usr/bin/python3 + update-alternatives --remove pip /usr/bin/pip3 autoremove } function check_prerequisite { if !(which pip); then - apt-get install python-pip -y + apt-get install python3-pip -y fi + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 if !(which curl); then apt-get install curl -y @@ -39,9 +43,9 @@ function check_prerequisite { } function clean_ironic_packages { - for package in python-ironicclient \ - python-ironic-inspector-client \ - python-openstackclient genisoimage; do + for package in python3-ironicclient \ + python3-ironic-inspector-client \ + python3-openstackclient genisoimage; do apt-get remove $package -y done } -- 2.16.6