Update to python3 72/4372/2
authorTodd Malsbary <todd.malsbary@intel.com>
Wed, 7 Jul 2021 23:00:54 +0000 (16:00 -0700)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Tue, 20 Jul 2021 18:09:07 +0000 (18:09 +0000)
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ib85b95e48cc1ce4d64cf54b8a6e82c8cd810c3c5

ci/roles/jenkins-config/tasks/jenkins_gerrit.yaml
deploy/metal3-vm/ubuntu_install_requirements.sh
deploy/metal3-vm/vm-setup/roles/libvirt/defaults/main.yml
env/cd_package_installer.sh
env/metal3/01_install_package.sh
env/ubuntu/bootloader-env/01_bootloader_package_req.sh
env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh

index e19173e..5e37181 100644 (file)
@@ -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)
index fc1974d..5559c63 100755 (executable)
@@ -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
index 1dc5f3b..3e477b0 100644 (file)
@@ -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
index e6641d6..abf8429 100755 (executable)
@@ -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
index 485fd18..4d4be9f 100755 (executable)
@@ -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
index da4165d..737285d 100755 (executable)
@@ -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
 
index 54c9ab3..1f6c474 100755 (executable)
@@ -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
 }