Code Review
/
icn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update to python3
[icn.git]
/
env
/
ubuntu
/
bootloader-env
/
02_clean_bootloader_package_req.sh
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
a2130a0
..
1f6c474
100755
(executable)
--- a/
env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh
+++ b/
env/ubuntu/bootloader-env/02_clean_bootloader_package_req.sh
@@
-1,5
+1,5
@@
#!/usr/bin/env bash
#!/usr/bin/env bash
-set -e
x
+set -e
ux -o pipefail
source $(dirname $PWD)/../lib/common.sh
source $(dirname $PWD)/../lib/logging.sh
source $(dirname $PWD)/../lib/common.sh
source $(dirname $PWD)/../lib/logging.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 \
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
+ python
3-pip python3-requests python3
-setuptools vim wget; do
apt-get remove $package -y
done
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
autoremove
}
function check_prerequisite {
if !(which pip); then
- apt-get install python-pip -y
+ apt-get install python
3
-pip -y
fi
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
if !(which curl); then
apt-get install curl -y
@@
-39,9
+43,9
@@
function check_prerequisite {
}
function clean_ironic_packages {
}
function clean_ironic_packages {
- for package in python-ironicclient \
- python-ironic-inspector-client \
- python-openstackclient genisoimage; do
+ for package in python
3
-ironicclient \
+ python
3
-ironic-inspector-client \
+ python
3
-openstackclient genisoimage; do
apt-get remove $package -y
done
}
apt-get remove $package -y
done
}
@@
-99,8
+103,8
@@
function clean_all {
systemctl disable kubelet
systemctl disable dockershim
systemctl disable criproxy
systemctl disable kubelet
systemctl disable dockershim
systemctl disable criproxy
- i
p link delete virbr0-nic
- i
p link delete virbr0
+ i
f ip link show | grep virbr0-nic > /dev/null; then ip link delete virbr0-nic; fi
+ i
f ip link show | grep virbr0 > /dev/null; then ip link delete virbr0; fi
}
function clean_apt_cache {
}
function clean_apt_cache {
@@
-149,7
+153,7
@@
if [ "$1" == "--only-packages" ]; then
fi
if [ "$1" == "--bm-cleanall" ]; then
fi
if [ "$1" == "--bm-cleanall" ]; then
- clean_all
+ clean_all
|| true
autoremove
exit 0
fi
autoremove
exit 0
fi