VOL-5155 - triage failure in periodic-voltha-test-bbsim-2.12

vars/pgrep_proc.groovy
vars/pkill_proc.groovy
----------------------
  o main: EXCEPTION org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: No such constructor found: new java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String org.codehaus.groovy.runtime.GStringImpl
  o groovy GString() cannot natively cast to java.String.
  o Manual cast to java.string using method .toString()

Change-Id: I6568a1210da32c8466582c6e1316a8a219d0bb51
diff --git a/vars/pgrep_proc.groovy b/vars/pgrep_proc.groovy
index ca3ab0b..556a599 100644
--- a/vars/pgrep_proc.groovy
+++ b/vars/pgrep_proc.groovy
@@ -51,7 +51,7 @@
 """)
     sh(
         label  : 'pgrep_proc', // jenkins usability: label log entry 'step'
-        script : "${cmd}",
+        script : ${cmd}.toString(),
     )
     return(ans)
 }
@@ -88,6 +88,10 @@
     return(ans)
 }
 
+// [SEE ALSO]
+// -----------------------------------------------------------------------
+//   o String cmd = [ ... ].join('') -- GString cannot cast to java.String
+//   o https://stackoverflow.com/questions/60304068/artifactory-in-jenkins-pipeline-org-codehaus-groovy-runtime-gstringimpl-cannot
 // -----------------------------------------------------------------------
 // [TODO] - Combine pkill_proc and pgrep_proc
 //    - Usage: do_proc(pkill=true, pgrep=true, args='proc-forward', cmd='kubectl'
diff --git a/vars/pkill_proc.groovy b/vars/pkill_proc.groovy
index 398444a..0a1fe5d 100644
--- a/vars/pkill_proc.groovy
+++ b/vars/pkill_proc.groovy
@@ -60,7 +60,7 @@
 
     sh(
         label  : 'pkill_proc', // jenkins usability: label log entry 'step'
-        script : "${cmd}",
+        script : cmd.toString(),
     )
 
     return(ans)
@@ -104,6 +104,10 @@
     return(ans)
 }
 
+// [SEE ALSO]
+// -----------------------------------------------------------------------
+//   o String cmd = [ ... ].join('') -- GString cannot cast to java.String
+//   o https://stackoverflow.com/questions/60304068/artifactory-in-jenkins-pipeline-org-codehaus-groovy-runtime-gstringimpl-cannot
 // -----------------------------------------------------------------------
 // [TODO] - Combine pkill_proc and pgrep_proc
 //    - Usage: do_proc(pkill=true, pgrep=true, args='proc-forward', cmd='kubectl'