Fix version override of Fuel release in dockerctl
Corrects options handling did not handle override of version so that one can correctly use the following commands: dockerctl -V 8.0 start postgres dockerctl --version 7.0 destroy nginx The wrong variable was in the template leaving the version defaulted to "", and then reverting to 8.0 as hardocded by the RPM. Switched to @release var name. Fixed varname for dockerctl config in hardcoded conf distributed in the RPM so it does not get replaced. Change-Id: Ia864b0a9843f927aa85945e5ab0b2da4bec3a440 Related-Commit: I28032852517ec8f7e959ad48a04621ec3e33fea1 Related-Bug: #1501368 Closes-Bug: #1510080
This commit is contained in:
parent
7759a70efe
commit
247d5d81e3
@ -5,11 +5,8 @@
|
||||
DOCKER_ROOT="/var/www/nailgun/docker"
|
||||
IMAGE_DIR="${DOCKER_ROOT}/images"
|
||||
SOURCE_DIR="${DOCKER_ROOT}/sources"
|
||||
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor.d"
|
||||
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor"
|
||||
#SUPERVISOR_CONF_DIR="<%= @config_dir %>/supervisor/"
|
||||
ASTUTE_YAML="<%= @astute_settings_file %>"
|
||||
VERSION="<%= @fuel_version %>"
|
||||
VERSION="${VERSION_OVERRIDE:-<%= @release %>}"
|
||||
DOCKER_ENGINE="<%= @container_engine %>"
|
||||
ADMIN_IP="<%= @admin_ipaddress %>"
|
||||
LOCAL_IP="127.0.0.1"
|
||||
|
@ -14,17 +14,18 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
confdir="/etc/dockerctl"
|
||||
. "$confdir/config"
|
||||
. "/usr/share/dockerctl/functions"
|
||||
DEBUG=true
|
||||
|
||||
|
||||
#Sets var nonopts
|
||||
# Sets var nonopts
|
||||
declare -a nonopts
|
||||
parse_options "$@"
|
||||
set -- "${nonopts[@]}"
|
||||
|
||||
# Parse config
|
||||
confdir="/etc/dockerctl"
|
||||
. "$confdir/config"
|
||||
|
||||
if [ -z "$1" ] || [ "$1" = "help" ]; then
|
||||
echo "Please specify a command."
|
||||
show_usage
|
||||
|
@ -5,17 +5,14 @@
|
||||
DOCKER_ROOT="/var/www/nailgun/docker"
|
||||
IMAGE_DIR="${DOCKER_ROOT}/images"
|
||||
SOURCE_DIR="${DOCKER_ROOT}/sources"
|
||||
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor.d"
|
||||
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor"
|
||||
#SUPERVISOR_CONF_DIR="<%= @config_dir %>/supervisor/"
|
||||
ASTUTE_YAML="/etc/fuel/astute.yaml"
|
||||
FUEL_VERSION_FILE="/etc/fuel_release"
|
||||
FUEL_RELEASE_FILE="/etc/fuel_release"
|
||||
DOCKER_ENGINE="native"
|
||||
ADMIN_IP="10.20.0.2"
|
||||
LOCAL_IP="127.0.0.1"
|
||||
|
||||
# Version of Fuel to deploy
|
||||
VERSION=$(cat $FUEL_VERSION_FILE)
|
||||
VERSION=${VERSION_OVERRIDE:-$(cat $FUEL_RELEASE_FILE)}
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION="_VERSION_"
|
||||
fi
|
||||
|
@ -42,10 +42,9 @@ function show_usage {
|
||||
}
|
||||
|
||||
function parse_options {
|
||||
opts="$@"
|
||||
for opt in $@; do
|
||||
case $opt in
|
||||
-V|--version) VERSION=$2
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
-V|--version) VERSION_OVERRIDE=$2
|
||||
shift 2
|
||||
;;
|
||||
-d|--debug) DEBUG=true
|
||||
|
Loading…
Reference in New Issue
Block a user