fix diagnostic collector

Change-Id: Ia20230b66f8de12bc8ad846a0f72426a99e7113f
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index bd9c997..5b72c4e 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -192,11 +192,7 @@
 }
 
 function run_diagnostics() {
-  echo "*** COLLECTING DIAGNOSTIC INFO NOT CURRENTLY IMPLEMENTED"
-  # Need to fix up inventory to collect info from compute nodes
-  # Using juju-ansible is one possibility
-  #echo "*** COLLECTING DIAGNOSTIC INFO - check ~/diag-* on the head node"
-  #ansible-playbook -i $INVENTORY cord-diag-playbook.yml
+  ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG PIrunDiag"
 }
 
 # Parse options
@@ -285,6 +281,13 @@
    add_compute_node compute-node-$i build_compute-node-$i
 done
 
+# run diagnostics both before/after the fabric/e2e tests
+if [[ $DIAGNOSTICS -eq 1 ]]
+then
+  run_diagnostics
+fi
+
+
 if [[ $FABRIC -ne 0 ]]
 then
   initialize_fabric