Skip to content

Commit 2563d3b

Browse files
Remove lolcat
As of the latest release, lolcat requires Python 2.7.16. Unfortunately, CentOS only provides Python 2.5. This PR introduces a `highlight` Bash function in common.sh, that will highlight the output, only slightly less unicornishly.
1 parent fb37173 commit 2563d3b

9 files changed

+35
-17
lines changed

Diff for: 01_install_requirements.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ sudo yum -y install epel-release
1313
sudo yum -y install curl vim-enhanced wget python-pip patch psmisc figlet golang
1414
sudo yum -y install https://dprince.fedorapeople.org/tmate-2.2.1-1.el7.centos.x86_64.rpm
1515

16-
sudo pip install lolcat
17-
1816
# for tripleo-repos install:
1917
sudo yum -y install python-setuptools python-requests
2018

@@ -38,7 +36,7 @@ sudo tripleo-repos current-tripleo
3836

3937
TRIPLEO_A=${TRIPLEO_VERSION:0:2}
4038
TRIPLEO_B=${TRIPLEO_VERSION:2:2}
41-
echo Pinned to tripleo version $TRIPLEO_A/$TRIPLEO_B/$TRIPLEO_VERSION | lolcat
39+
echo Pinned to tripleo version $TRIPLEO_A/$TRIPLEO_B/$TRIPLEO_VERSION | highlight
4240
sudo sed -i -e "{[email protected]/centos7/.*@trunk.rdoproject.org/centos7/$TRIPLEO_A/$TRIPLEO_B/$TRIPLEO_VERSION@}" /etc/yum.repos.d/delorean.repo
4341

4442
sudo yum -y update
@@ -63,7 +61,7 @@ fi
6361

6462
# Set hostname properly.
6563
HOSTNAME=`host $LOCAL_IP | cut -f 5 -d ' ' | sed s/.$//`
66-
echo $HOSTNAME | lolcat
64+
echo $HOSTNAME | highlight
6765
sudo hostnamectl set-hostname $HOSTNAME
6866

6967
# We need this before tripleo now because octavia expects keys.

Diff for: 02_run_all_in_one.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ parameter_defaults:
5050
$PARAMETERS_EXTRA
5151
EOF_CAT
5252

53-
lolcat $SCRIPTDIR/standalone_parameters.yaml
53+
highlight $SCRIPTDIR/standalone_parameters.yaml
5454

5555
sudo openstack tripleo deploy \
5656
--templates $SCRIPTDIR/tripleo-heat-templates \

Diff for: 03_configure_undercloud.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source common.sh
66
# NOTE: this is the openstack admin section
77
export OS_CLOUD=standalone
88

9-
openstack endpoint list | lolcat
9+
openstack endpoint list | highlight
1010

1111
if ! openstack flavor show tiny; then
1212
openstack flavor create --ram 1024 --disk 10 --vcpu 2 --public tiny
@@ -54,10 +54,10 @@ if ! openstack image show amphora-image; then
5454
fi
5555

5656
HOST_LOCALDOMAIN=`hostname -A | sed 's/ /\n/g' | grep localdomain`
57-
echo $HOST_LOCALDOMAIN | lolcat
57+
echo $HOST_LOCALDOMAIN | highlight
5858
neutron port-update --binding:host_id=$HOST_LOCALDOMAIN $(openstack port list -c ID -c Name | grep health | cut -f2 -d " ")
5959

60-
echo To test: openstack loadbalancer create --vip-subnet-id public-subnet --name lb1 | lolcat
60+
echo To test: openstack loadbalancer create --vip-subnet-id public-subnet --name lb1 | highlight
6161

6262
# Create a user without any admin priviledges
6363
if ! openstack project show openshift; then
@@ -121,7 +121,7 @@ Host $NETWORK.*
121121
EOF
122122
fi
123123

124-
lolcat <<EOF
124+
highlight <<EOF
125125
Undercloud installed and configured. To test:
126126
127127
export OS_CLOUD=openshift

Diff for: 04_ocp_repo_sync.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ set -ex
44
source common.sh
55

66
eval "$(go env)"
7-
echo "$GOPATH" | lolcat # should print $HOME/go or something like that
7+
echo "$GOPATH" | highlight # should print $HOME/go or something like that
88

99
function sync_go_repo_and_patch {
1010
DEST="$GOPATH/src/$1"
11-
figlet "Syncing $1" | lolcat
11+
figlet "Syncing $1" | highlight
1212

1313
if [ ! -d $DEST ]; then
1414
mkdir -p $DEST

Diff for: 05_build_ocp_installer.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ set -ex
44

55
source common.sh
66

7-
figlet "Building the Installer" | lolcat
7+
figlet "Building the Installer" | highlight
88

99
eval "$(go env)"
10-
echo "$GOPATH" | lolcat # should print $HOME/go or something like that
10+
echo "$GOPATH" | highlight # should print $HOME/go or something like that
1111

1212
pushd "$GOPATH/src/github.com/openshift/installer"
1313
export MODE=dev

Diff for: 07_build_ci_operator.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -ex
55
source common.sh
66

77
eval "$(go env)"
8-
echo "$GOPATH" | lolcat
8+
echo "$GOPATH" | highlight
99

1010

1111
pushd "$GOPATH/src/github.com/openshift/ci-operator"

Diff for: common.sh

+20
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,23 @@ export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="registry.svc.ci.openshift.org/o
3030
# You can get the latest hash here:
3131
# https://trunk.rdoproject.org/centos7/current-tripleo/commit.yaml
3232
TRIPLEO_VERSION='25698ebfff692178450478b5207b09ca99d277b2_aba8ec54'
33+
34+
# Use some color to highlight actionable output
35+
highlight() {
36+
set +x
37+
38+
local IFS
39+
local set_bold
40+
local reset
41+
42+
set_bold="$(tput setaf 3)$(tput bold)"
43+
reset="$(tput sgr0)"
44+
45+
set -- "${1:-/dev/stdin}" "${@:2}"
46+
47+
for f in "$@"; do
48+
while read -r line; do
49+
printf "%s%s%s\n" "$set_bold" "$line" "$reset"
50+
done < "$f"
51+
done
52+
}

Diff for: expose_ocp_api.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source common.sh
1212

1313
LB_FLOATING_IP=$(openstack server show ${CLUSTER_NAME}-api -f value -c addresses | cut -d " " -f 2)
1414

15-
echo "Attempting to expose cluster's API on floating IP: ${LB_FLOATING_IP}" | lolcat
15+
echo "Attempting to expose cluster's API on floating IP: ${LB_FLOATING_IP}" | highlight
1616

1717
if ! grep -q ${LB_FLOATING_IP} /etc/hosts ; then
1818
(echo "${LB_FLOATING_IP} api.${CLUSTER_NAME}.shiftstack.com" && grep -v "api.${CLUSTER_NAME}.shiftstack.com" /etc/hosts) | sudo tee /etc/hosts

Diff for: install_docker_registry.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -ex
55
source common.sh
66

77
eval "$(go env)"
8-
echo "$GOPATH" | lolcat
8+
echo "$GOPATH" | highlight
99

1010
if [ "$(cat /proc/sys/user/max_user_namespaces)" = "0" ]; then
1111
echo 10000 | sudo tee /proc/sys/user/max_user_namespaces
@@ -17,7 +17,7 @@ if ! grep -q $USER /etc/subgid ; then
1717
echo $USER:10000:65536 | sudo tee -a /etc/subgid
1818
fi
1919

20-
figlet "Run docker registry" | lolcat
20+
figlet "Run docker registry" | highlight
2121

2222
OVERRIDE_IMAGES=""
2323
sudo podman rm -f registry || true

0 commit comments

Comments
 (0)