Merge "Make port-forwarding removal more robust"
diff --git a/jjb/pipeline/voltha/physical-build.groovy b/jjb/pipeline/voltha/physical-build.groovy
index 69537b3..8745ef5 100755
--- a/jjb/pipeline/voltha/physical-build.groovy
+++ b/jjb/pipeline/voltha/physical-build.groovy
@@ -16,7 +16,6 @@
// NOTE we are importing the library even if it's global so that it's
// easier to change the keywords during a replay
-
library identifier: 'cord-jenkins-libraries@master',
retriever: modernSCM([
$class: 'GitSCMSource',
diff --git a/vars/pkill_port_forward.groovy b/vars/pkill_port_forward.groovy
index 2de9759..7a0b235 100644
--- a/vars/pkill_port_forward.groovy
+++ b/vars/pkill_port_forward.groovy
@@ -85,11 +85,11 @@
}
sh(
- label : 'Display port forwarding',
+ label : 'Kill port forwarding',
// script : ${cmd}.toString(), -> Exception
script : """
echo -e "\n** vars/pkill_port_forward.groovy [DEBUG]: pgrep-pkill check"
-if [[ \$(pgrep --count 'port-forw') -gt 0 ]]; then
+if pgrep --uid \$(id -u) --list-full --full 'port-forw'; then
pkill --uid \$(id -u) --echo --list-full --full 'port-forw'
fi
""")