summaryrefslogtreecommitdiffstats
path: root/k8s/k8splugin/decorators.py
diff options
context:
space:
mode:
authorJack Lucas <jflucas@research.att.com>2018-07-17 21:34:22 +0000
committerJack Lucas <jflucas@research.att.com>2018-07-17 21:36:18 +0000
commit4fbbe8f6279c7c9b1e66c7b85f0ecbfa558d4c98 (patch)
tree038669a54139fe4cea712c31f6114c6d19711068 /k8s/k8splugin/decorators.py
parent8db18d78975af115f44c84c170f678fc34001789 (diff)
Add support for updating image.
- Refactor type file to reduce duplication - General code cleanup Change-Id: I80354736100dcd3544db2f751335d704bd240666 Issue-ID: DCAEGEN2-543 Signed-off-by: Jack Lucas <jflucas@research.att.com>
Diffstat (limited to 'k8s/k8splugin/decorators.py')
-rw-r--r--k8s/k8splugin/decorators.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/k8s/k8splugin/decorators.py b/k8s/k8splugin/decorators.py
index 2edcc0d..59d14d8 100644
--- a/k8s/k8splugin/decorators.py
+++ b/k8s/k8splugin/decorators.py
@@ -98,3 +98,17 @@ def merge_inputs_for_start(task_start_func):
ctx.instance.runtime_properties, **kwargs)
return wrapper
+
+def wrap_error_handling_update(update_func):
+ """ Wrap error handling for update operations (scale and upgrade) """
+
+ def wrapper(**kwargs):
+ try:
+ return update_func(**kwargs)
+ except DockerPluginDeploymentError:
+ raise NonRecoverableError ("Update operation did not complete successfully in the alloted time")
+ except Exception as e:
+ ctx.logger.error ("Unexpected error during update operation: {0}".format(str(e)))
+ raise NonRecoverableError(e)
+
+ return wrapper \ No newline at end of file