summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladyslav Drok <vdrok@mirantis.com>2018-11-02 10:52:48 -0700
committerVladyslav Drok <vdrok@mirantis.com>2018-11-02 22:37:12 +0000
commit1986a935f6dcfac70e348a874ddf90011c064c60 (patch)
treedec11d8a48c0b9392f25a6a19c7d64a7de0cf8f6
parentbf476b084b1af565c60173f84c9d570b31922b53 (diff)
Don't swallow exceptions when doing tiller actions
Notes
Notes (review): Code-Review+2: Felipe Monteiro <felipe.monteiro@att.com> Code-Review+1: Drew Walters <drewwalters96@gmail.com> Code-Review+2: Aaron Sheffield <ajs@sheffieldfamily.net> Workflow+1: Aaron Sheffield <ajs@sheffieldfamily.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 05 Nov 2018 16:47:42 +0000 Reviewed-on: https://review.openstack.org/615264 Project: openstack/airship-armada Branch: refs/heads/master
-rw-r--r--armada/handlers/tiller.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/armada/handlers/tiller.py b/armada/handlers/tiller.py
index 338a387..df76dbe 100644
--- a/armada/handlers/tiller.py
+++ b/armada/handlers/tiller.py
@@ -127,6 +127,7 @@ class Tiller(object):
127 ('grpc.max_receive_message_length', 127 ('grpc.max_receive_message_length',
128 MAX_MESSAGE_LENGTH)]) 128 MAX_MESSAGE_LENGTH)])
129 except Exception: 129 except Exception:
130 LOG.exception('Failed to initialize grpc channel to tiller.')
130 raise ex.ChannelException() 131 raise ex.ChannelException()
131 132
132 def _get_tiller_pod(self): 133 def _get_tiller_pod(self):
@@ -312,7 +313,12 @@ class Tiller(object):
312 name, release_name, namespace, labels, action_type, chart, 313 name, release_name, namespace, labels, action_type, chart,
313 disable_hooks, values, timeout) 314 disable_hooks, values, timeout)
314 except Exception: 315 except Exception:
315 LOG.warn("Pre: Could not update anything, please check yaml") 316 LOG.excpetion(
317 "Pre-action failure: could not perform rolling upgrade for "
318 "%(res_type)s %(res_name)s.", {
319 'res_type': action_type,
320 'res_name': name
321 })
316 raise ex.PreUpdateJobDeleteException(name, namespace) 322 raise ex.PreUpdateJobDeleteException(name, namespace)
317 323
318 try: 324 try:
@@ -329,7 +335,12 @@ class Tiller(object):
329 namespace, 335 namespace,
330 timeout=timeout) 336 timeout=timeout)
331 except Exception: 337 except Exception:
332 LOG.warn("PRE: Could not delete anything, please check yaml") 338 LOG.excpetion(
339 "Pre-action failure: could not delete %(res_type)s "
340 "%(res_name)s.", {
341 'res_type': action_type,
342 'res_name': name
343 })
333 raise ex.PreUpdateJobDeleteException(name, namespace) 344 raise ex.PreUpdateJobDeleteException(name, namespace)
334 345
335 def list_charts(self): 346 def list_charts(self):
@@ -530,6 +541,7 @@ class Tiller(object):
530 return release_status 541 return release_status
531 542
532 except Exception: 543 except Exception:
544 LOG.exception('Cannot get tiller release status.')
533 raise ex.GetReleaseStatusException(release, version) 545 raise ex.GetReleaseStatusException(release, version)
534 546
535 def get_release_content(self, release, version=0): 547 def get_release_content(self, release, version=0):
@@ -551,6 +563,7 @@ class Tiller(object):
551 return release_content 563 return release_content
552 564
553 except Exception: 565 except Exception:
566 LOG.exception('Cannot get tiller release content.')
554 raise ex.GetReleaseContentException(release, version) 567 raise ex.GetReleaseContentException(release, version)
555 568
556 def tiller_version(self): 569 def tiller_version(self):
@@ -570,7 +583,7 @@ class Tiller(object):
570 return tiller_version 583 return tiller_version
571 584
572 except Exception: 585 except Exception:
573 LOG.debug('Failed to get Tiller version') 586 LOG.exception('Failed to get Tiller version.')
574 raise ex.TillerVersionException() 587 raise ex.TillerVersionException()
575 588
576 def uninstall_release(self, release, disable_hooks=False, purge=True): 589 def uninstall_release(self, release, disable_hooks=False, purge=True):
@@ -794,6 +807,7 @@ class Tiller(object):
794 return 807 return
795 808
796 except Exception: 809 except Exception:
810 LOG.exception('Error while rolling back tiller release.')
797 raise ex.RollbackReleaseException(release_name, version) 811 raise ex.RollbackReleaseException(release_name, version)
798 812
799 def _check_timeout(self, wait, timeout): 813 def _check_timeout(self, wait, timeout):