log actual exceptions on debugging

This commit is contained in:
Sergey Dudoladov 2020-11-09 08:23:13 +01:00
parent e10b2e31da
commit af412e7b2f
1 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ from datetime import datetime
from kubernetes import client from kubernetes import client
from tests.k8s_api import K8s from tests.k8s_api import K8s
from kubernetes.client.rest import ApiException
SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-12:1.6-p5" SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-12:1.6-p5"
SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-cdp-12:1.6-p114" SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-cdp-12:1.6-p114"
@ -87,8 +88,8 @@ class EndToEndTestCase(unittest.TestCase):
# remove existing local storage class and create hostpath class # remove existing local storage class and create hostpath class
try: try:
k8s.api.storage_v1_api.delete_storage_class("standard") k8s.api.storage_v1_api.delete_storage_class("standard")
except: except ApiException as e:
print("Storage class has already been remove") print("Failed to delete the 'standard' storage class: {0}".format(e))
# operator deploys pod service account there on start up # operator deploys pod service account there on start up
# needed for test_multi_namespace_support() # needed for test_multi_namespace_support()
@ -96,8 +97,8 @@ class EndToEndTestCase(unittest.TestCase):
try: try:
v1_namespace = client.V1Namespace(metadata=client.V1ObjectMeta(name=cls.namespace)) v1_namespace = client.V1Namespace(metadata=client.V1ObjectMeta(name=cls.namespace))
k8s.api.core_v1.create_namespace(v1_namespace) k8s.api.core_v1.create_namespace(v1_namespace)
except: except ApiException as e:
print("Namespace already present") print("Failed to create the '{0}' namespace: {1}".format(cls.namespace, e))
# submit the most recent operator image built on the Docker host # submit the most recent operator image built on the Docker host
with open("manifests/postgres-operator.yaml", 'r+') as f: with open("manifests/postgres-operator.yaml", 'r+') as f: