VOL-4795 - Researching berlin-community-pod issues.
vars/volthaInfraDeploy.groovy
-----------------------------
o Wrap call() in a try/catch/finally block for error visibility.
o Added named function doKubeNamespaces() to capture logic.
o Display namespace(s) prior to helm update, considering removal for clean install.
o Problem may be related to special case behavor trying to update a new creation
vars/volthaStackDeploy.groovy
-----------------------------
o Wrap call() in a try/catch/finally block for error visibility.
vars/waitForAdapter.groovy
--------------------------
o Fix iam() method name
o npm-groovy-lint cleanups
Change-Id: Ib9407b9cfefc40f411dbf9ab6e9e25adf9741a58
diff --git a/vars/volthaStackDeploy.groovy b/vars/volthaStackDeploy.groovy
index eb6ab0b..5e511d0 100644
--- a/vars/volthaStackDeploy.groovy
+++ b/vars/volthaStackDeploy.groovy
@@ -1,10 +1,18 @@
#!/usr/bin/env groovy
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+def getIam(String func)
+{
+ // Cannot rely on a stack trace due to jenkins manipulation
+ String src = 'vars/volthaStackDeploy.groovy'
+ String iam = [src, func].join('::')
+ return iam
+}
-def call(Map config) {
-
- String iam = 'vars/volthaStackDeploy.groovy'
- println("** ${iam}: ENTER")
-
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+def process(Map config)
+{
// note that I can't define this outside the function as there's no global scope in Groovy
def defaultConfig = [
bbsimReplica: 1,
@@ -21,10 +29,6 @@
adaptersToWait: 2,
]
- if (!config) {
- config = [:]
- }
-
def cfg = defaultConfig + config
def volthaStackChart = "onf/voltha-stack"
@@ -126,5 +130,34 @@
done
"""
- println("** ${iam}: LEAVE")
+ return
}
+
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+def call(Map config)
+{
+ String iam = getIam('main')
+ println("** ${iam}: ENTER")
+
+ if (!config) {
+ config = [:]
+ }
+
+ try
+ {
+ process(config)
+ }
+ catch (Exception err)
+ {
+ println("** ${iam}: EXCEPTION ${err}")
+ throw err
+ }
+ finally
+ {
+ println("** ${iam}: LEAVE")
+ }
+ return
+}
+
+// [EOF]