summaryrefslogtreecommitdiffstats
path: root/k8s/k8splugin/decorators.py
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2018-07-18 20:32:08 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-18 20:32:08 +0000
commit926eb8c21979a6972838dae8e9de29903d1b26f1 (patch)
tree31760d1f8c8cf6d27b3f294b22b5067f135e366f /k8s/k8splugin/decorators.py
parent719a5c0ce0a49cb156993fb0aeabfb3dd49b50a6 (diff)
parent4fbbe8f6279c7c9b1e66c7b85f0ecbfa558d4c98 (diff)
Merge "Add support for updating image."
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