From 76a3ae6ca2e5655b66d0448890c891713aa6954d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 28 Jun 2017 09:13:04 -0400 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). -- Note This is a combined cherry-pick of the following 2c0faca0380050b697b7d7fe6589102fa8a0cb5d - add version 3415521d5659b2268b8984bf89ede8e34f1b76f7 - fix to ^ 07cbc4494255efa2c394b4b60e5beaa3d10f244e - this change 2c0faca and 3415522 were not merged to this branch at the time to avoid breakage. This brings consistency across the open branches. Change-Id: Ic7391dd087657c0daf74046e4a052c53f4eb6e1a --- functions | 12 ++++++++++++ stack.sh | 7 +++++++ stackrc | 1 + 3 files changed, 20 insertions(+) diff --git a/functions b/functions index 1aa7517a8a..a9e1451755 100644 --- a/functions +++ b/functions @@ -691,6 +691,18 @@ function enable_kernel_bridge_firewall { done } +# Save some state information +# +# Write out various useful state information to /etc/devstack-version +function write_devstack_version { + cat - > /tmp/devstack-version <