From 74e0c1c284cf0ee0d7a7e312335be6f0dab2b27f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 30 Jun 2017 12:29:19 +1000 Subject: [PATCH] Put devstack-version info into separate file As a follow on to I4c269a7f3d63ee9a976e7c3636fc3e5e8dab9ae3; the quoting gets tricky when putting arbitrary command-substitution strings into saved echo-able strings. As they say, "the only winning move is not to play" :) An alternative proposal is to not write this into a script but just dump info into a file. To my mind, this has several advantages -- avoid getting involved in quoting, not dropping a script into the global environment -- it's just as easy to "cat" -- and the plain-text file can be collected as an artifact during log collection (also moved git commit line to separate line for easier parsing during log search, etc). Change-Id: Ic7391dd087657c0daf74046e4a052c53f4eb6e1a (Cherry-picked from 07cbc4494255efa2c394b4b60e5beaa3d10f244e) --- functions | 16 +++++++--------- stack.sh | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/functions b/functions index 3847ffec4c..834a1e1e05 100644 --- a/functions +++ b/functions @@ -673,18 +673,16 @@ function enable_kernel_bridge_firewall { done } +# Save some state information +# +# Write out various useful state information to /etc/devstack-version function write_devstack_version { - pushd $TOP_DIR - local git_version="" - git_version=$(git log --format="%H %ci" -1) cat - > /tmp/devstack-version <