From f2125faf4dc95715f45a7f0ed4d3e5bbab9c5d32 Mon Sep 17 00:00:00 2001
From: Rahul Khiyani <rahul.khiyani@att.com>
Date: Tue, 3 Dec 2019 16:38:12 -0600
Subject: [PATCH] Ceph-utility python and Ubuntu upgrade.

This Patchset updated Ubuntu to  Bionic
and Python from 2.0 to 3.0

Change-Id: I0e967fa7f7f4d4a5619489a9da79b6561da9c9cb
---
 charts/ceph-utility/templates/bin/_managekey.sh.tpl       | 8 ++++----
 .../templates/bin/utility/_ceph-utility-rootwrap.tpl      | 2 +-
 charts/ceph-utility/values.yaml                           | 2 +-
 ...{Dockerfile.ubuntu_xenial => Dockerfile.ubuntu_bionic} | 6 +++---
 zuul.d/ceph-utility.yaml                                  | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)
 rename images/ceph-utility/{Dockerfile.ubuntu_xenial => Dockerfile.ubuntu_bionic} (83%)

diff --git a/charts/ceph-utility/templates/bin/_managekey.sh.tpl b/charts/ceph-utility/templates/bin/_managekey.sh.tpl
index 62928ce7..5de2674d 100644
--- a/charts/ceph-utility/templates/bin/_managekey.sh.tpl
+++ b/charts/ceph-utility/templates/bin/_managekey.sh.tpl
@@ -29,7 +29,7 @@ root logger by oslo-rootwrap module, imported in _openstack-utility-rootwrap.tpl
 These lines will get rid of duplicate logs, generated because of the formatter
 attached by oslo-rootwrap.
 */}}
-sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py
-sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py
-sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py
-sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py
+sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py
+sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py
+sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py
+sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py
diff --git a/charts/ceph-utility/templates/bin/utility/_ceph-utility-rootwrap.tpl b/charts/ceph-utility/templates/bin/utility/_ceph-utility-rootwrap.tpl
index 74cf1b05..ab010a89 100644
--- a/charts/ceph-utility/templates/bin/utility/_ceph-utility-rootwrap.tpl
+++ b/charts/ceph-utility/templates/bin/utility/_ceph-utility-rootwrap.tpl
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 {{/*
 Copyright 2019 The Openstack-Helm Authors.
 
diff --git a/charts/ceph-utility/values.yaml b/charts/ceph-utility/values.yaml
index bd500344..f1f7da41 100644
--- a/charts/ceph-utility/values.yaml
+++ b/charts/ceph-utility/values.yaml
@@ -25,7 +25,7 @@ release_group: null
 images:
   pull_policy: IfNotPresent
   tags:
-    ceph_utility: 'quay.io/airshipit/porthole-ceph-utility:latest-ubuntu_xenial'
+    ceph_utility: 'quay.io/airshipit/porthole-ceph-utility:latest-ubuntu_bionic'
     image_repo_sync: docker.io/docker:18.09.02
   local_registry:
     active: false
diff --git a/images/ceph-utility/Dockerfile.ubuntu_xenial b/images/ceph-utility/Dockerfile.ubuntu_bionic
similarity index 83%
rename from images/ceph-utility/Dockerfile.ubuntu_xenial
rename to images/ceph-utility/Dockerfile.ubuntu_bionic
index 4f2e8356..2b45e784 100755
--- a/images/ceph-utility/Dockerfile.ubuntu_xenial
+++ b/images/ceph-utility/Dockerfile.ubuntu_bionic
@@ -1,4 +1,4 @@
-ARG FROM=docker.io/ubuntu:xenial
+ARG FROM=docker.io/ubuntu:bionic
 FROM ${FROM}
 
 LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
@@ -18,8 +18,8 @@ RUN set -xe \
     && apt-get update && apt-get dist-upgrade -y \
     && apt-get install -y wget curl apt-transport-https ca-certificates gnupg\
     && wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - \
-    && echo deb https://download.ceph.com/debian-${CEPH_RELEASE}/ xenial main | tee /etc/apt/sources.list.d/ceph.list \
-    && apt-get update && apt-get install -y bash python-oslo.rootwrap moreutils vim sudo screen ceph ceph-common python-rbd radosgw rsyslog hexedit jq s3cmd rsync xz-utils iperf \
+    && echo deb https://download.ceph.com/debian-${CEPH_RELEASE}/ bionic main | tee /etc/apt/sources.list.d/ceph.list \
+    && apt-get update && apt-get install -y bash python3 python3-pip python3-oslo.rootwrap moreutils vim sudo screen ceph ceph-common python-rbd radosgw rsyslog hexedit jq s3cmd rsync xz-utils iperf \
     && apt-get remove --purge -y wget apt-transport-https && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* \
     && TMP_DIR=$(mktemp --directory) \
     && cd ${TMP_DIR} \
diff --git a/zuul.d/ceph-utility.yaml b/zuul.d/ceph-utility.yaml
index 94edda82..35b09474 100644
--- a/zuul.d/ceph-utility.yaml
+++ b/zuul.d/ceph-utility.yaml
@@ -17,7 +17,7 @@
     parent: &parent airship-porthole-images
     vars:
       image_name: &image_name porthole-ceph-utility
-      distro_suffix: &distro_suffix ubuntu_xenial
+      distro_suffix: &distro_suffix ubuntu_bionic
     files:
       - ^charts/ceph-utility/.*$
       - ^images/ceph-utility/.*$