Merge "Put devstack-version info into separate file"
diff --git a/functions b/functions
index f04bc1f..6f2164a 100644
--- a/functions
+++ b/functions
@@ -750,19 +750,16 @@
echo $port
}
-
+# 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 <<EOF
-#!/bin/bash
-
-echo "DevStack Version: ${DEVSTACK_SERIES} - ${git_version}"
-echo "OS Version: ${os_VENDOR} ${os_RELEASE} ${os_CODENAME}"
-
+DevStack Version: ${DEVSTACK_SERIES}
+Change: $(git log --format="%H %s %ci" -1)
+OS Version: ${os_VENDOR} ${os_RELEASE} ${os_CODENAME}
EOF
- sudo install -m 755 /tmp/devstack-version /usr/local/bin/devstack-version
+ sudo install -m 644 /tmp/devstack-version /etc/devstack-version
rm /tmp/devstack-version
}
diff --git a/stack.sh b/stack.sh
index fd18651..c453b91 100755
--- a/stack.sh
+++ b/stack.sh
@@ -216,7 +216,7 @@
fi
source $TOP_DIR/stackrc
-# this installs a devstack-version script to make it easy to report the version back
+# write /etc/devstack-version
write_devstack_version
# Warn users who aren't on an explicitly supported distro, but allow them to
@@ -1538,8 +1538,8 @@
echo
fi
-# devstack version
-devstack-version
+# Useful info on current state
+cat /etc/devstack-version
echo
# Indicate how long this took to run (bash maintained variable ``SECONDS``)