From 8f290d3b8d2a8d787f107d05b3be0199d33d7026 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Thu, 7 Mar 2019 12:57:56 +0100 Subject: [PATCH] make db-{drop,init) py3 compatible They are using the old ConfigParser library which is lowercase under py3, so try to import the correct one if the script are run under py3 Change-Id: I4362f55933f7dfe2198da8e5d1aa1f33d3fb821e --- helm-toolkit/templates/scripts/_db-drop.py.tpl | 5 ++++- helm-toolkit/templates/scripts/_db-init.py.tpl | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/helm-toolkit/templates/scripts/_db-drop.py.tpl b/helm-toolkit/templates/scripts/_db-drop.py.tpl index 2f661bccf..55280c618 100644 --- a/helm-toolkit/templates/scripts/_db-drop.py.tpl +++ b/helm-toolkit/templates/scripts/_db-drop.py.tpl @@ -27,7 +27,10 @@ limitations under the License. import os import sys -import ConfigParser +try: + import ConfigParser +except ImportError: + import configparser as ConfigParser import logging from sqlalchemy import create_engine diff --git a/helm-toolkit/templates/scripts/_db-init.py.tpl b/helm-toolkit/templates/scripts/_db-init.py.tpl index c3a1b6dff..ca0ff5828 100644 --- a/helm-toolkit/templates/scripts/_db-init.py.tpl +++ b/helm-toolkit/templates/scripts/_db-init.py.tpl @@ -27,7 +27,10 @@ limitations under the License. import os import sys -import ConfigParser +try: + import ConfigParser +except ImportError: + import configparser as ConfigParser import logging from sqlalchemy import create_engine