VOL-4836 - use newer version of voltctl.
vars/installVoltctl.groovy
--------------------------
o Wrap script logic in a try/catch/finally block to better report errors.
o Define a (commented) version for the upcoming voltha-2.11 release.
o Remove voltctl filesystem debugging statements added earlier.
o Call vars/showCommand to display searchpath and command version.
vars/showCommand
----------------
o Library method for displaying command-by-path and version.
Change-Id: I93ca923d7556a73a36ed024eea4975dee0fe9c6d
diff --git a/vars/showCommands.groovy b/vars/showCommands.groovy
new file mode 100644
index 0000000..8f02ce0
--- /dev/null
+++ b/vars/showCommands.groovy
@@ -0,0 +1,57 @@
+#!/usr/bin/env groovy
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+def getIam(String func)
+{
+ // Cannot rely on a stack trace due to jenkins manipulation
+ String src = 'vars/showCommands'
+ String iam = [src, func].join('::')
+ return iam
+}
+
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+def process(Map config)
+{
+ // String iam = getIam('process')
+
+ // list.each{ } could be used here but simple for now.
+ println("** ${iam}: voltctl command attributes")
+ sh('''which -a voltctl''')
+ sh('''voltctl version''')
+
+ 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