From edee6dc341e40939360b36ce9fd09052dea1ee4d Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 12 Jan 2021 14:04:38 -0800 Subject: [PATCH] Add debug helper script I'm not sure if others will find this useful, but I use this script to run pieces of devstack while trying to write/debug things. It saves me a lot of time being able to get to some project-lib function without a full clean/re-stack. Figured I'd share in case it's worth putting into the tree. Change-Id: I9a92fa71d34f50c2f5ba7d11c1a45301bd4478bf --- tools/debug_function.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tools/debug_function.sh diff --git a/tools/debug_function.sh b/tools/debug_function.sh new file mode 100755 index 0000000000..68bd85dc61 --- /dev/null +++ b/tools/debug_function.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# This is a small helper to speed development and debug with devstack. +# It is intended to help you run a single function in a project module +# without having to re-stack. +# +# For example, to run the just start_glance function, do this: +# +# ./tools/debug_function.sh glance start_glance + +if [ ! -f "lib/$1" ]; then + echo "Usage: $0 [project] [function] [function...]" +fi + +source stackrc +source lib/$1 +shift +set -x +while [ "$1" ]; do + echo ==== Running $1 ==== + $1 + echo ==== Done with $1 ==== + shift +done