summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Walters <drewwalters96@gmail.com>2018-11-12 20:36:36 +0000
committerDrew Walters <drewwalters96@gmail.com>2018-11-13 16:32:21 +0000
commit5cafd027b51eb989fd9d734d1684e2a25bd69492 (patch)
treea33b38a1b6975829f8e7244545f710c3a63c535a
parent4b76fda6b41a7face9bcb2970d9bb8407c8fac45 (diff)
tiller: Remove unused params from delete_resources
Parameters `release_name` and `name` are ignored by the Tiller handler's `delete_resources` method because the deletions are handled using labels rather than by name. Currently, values that do not represent the parameters are being passed to the method, which sometimes leads to cryptic logging messages. This change removes all references to the aforementioned parameters and clarifies the corresponding docstring and log message. Change-Id: Ic43819a273bf9da5e8965f409a56307eb11b4922
Notes
Notes (review): Code-Review+1: Andrey Volkov <av903u@att.com> Code-Review+2: Sean Eagan <sean.eagan@att.com> Code-Review+2: Aaron Sheffield <ajs@sheffieldfamily.net> Workflow+1: Aaron Sheffield <ajs@sheffieldfamily.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 14 Nov 2018 19:37:33 +0000 Reviewed-on: https://review.openstack.org/617380 Project: openstack/airship-armada Branch: refs/heads/master
-rw-r--r--armada/handlers/tiller.py26
1 files changed, 8 insertions, 18 deletions
diff --git a/armada/handlers/tiller.py b/armada/handlers/tiller.py
index df76dbe..aa92aa2 100644
--- a/armada/handlers/tiller.py
+++ b/armada/handlers/tiller.py
@@ -328,12 +328,7 @@ class Tiller(object):
328 labels = action.get('labels', None) 328 labels = action.get('labels', None)
329 329
330 self.delete_resources( 330 self.delete_resources(
331 release_name, 331 action_type, labels, namespace, timeout=timeout)
332 name,
333 action_type,
334 labels,
335 namespace,
336 timeout=timeout)
337 except Exception: 332 except Exception:
338 LOG.excpetion( 333 LOG.excpetion(
339 "Pre-action failure: could not delete %(res_type)s " 334 "Pre-action failure: could not delete %(res_type)s "
@@ -621,21 +616,18 @@ class Tiller(object):
621 raise ex.ReleaseException(release, status, 'Delete') 616 raise ex.ReleaseException(release, status, 'Delete')
622 617
623 def delete_resources(self, 618 def delete_resources(self,
624 release_name,
625 resource_name,
626 resource_type, 619 resource_type,
627 resource_labels, 620 resource_labels,
628 namespace, 621 namespace,
629 wait=False, 622 wait=False,
630 timeout=const.DEFAULT_TILLER_TIMEOUT): 623 timeout=const.DEFAULT_TILLER_TIMEOUT):
631 ''' 624 '''
632 :param release_name: release name the specified resource is under 625 Delete resources matching provided resource type, labels, and
633 :param resource_name: name of specific resource 626 namespace.
634 :param resource_type: type of resource e.g. job, pod, etc.
635 :param resource_labels: labels by which to identify the resource
636 :param namespace: namespace of the resource
637 627
638 Apply deletion logic based on type of resource 628 :param resource_type: type of resource e.g. job, pod, etc.
629 :param resource_labels: labels for selecting the resources
630 :param namespace: namespace of resources
639 ''' 631 '''
640 timeout = self._check_timeout(wait, timeout) 632 timeout = self._check_timeout(wait, timeout)
641 633
@@ -710,8 +702,8 @@ class Tiller(object):
710 handled = True 702 handled = True
711 703
712 if not handled: 704 if not handled:
713 LOG.error("Unable to execute name: %s type: %s ", resource_name, 705 LOG.error('No resources found with labels=%s type=%s namespace=%s',
714 resource_type) 706 resource_labels, resource_type, namespace)
715 707
716 def rolling_upgrade_pod_deployment(self, 708 def rolling_upgrade_pod_deployment(self,
717 name, 709 name,
@@ -760,8 +752,6 @@ class Tiller(object):
760 752
761 # delete pods 753 # delete pods
762 self.delete_resources( 754 self.delete_resources(
763 release_name,
764 name,
765 'pod', 755 'pod',
766 resource_labels, 756 resource_labels,
767 namespace, 757 namespace,