Skip to content

Commit

Permalink
Fix get_current_storage_options to work with and without docker
Browse files Browse the repository at this point in the history
If we are using docker-storage-setup, user could set DOCKER_STORAGE_OPTIONS
for all other cases it should be STORAGE_OPTIONS.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Mar 2, 2017
1 parent e75c987 commit 8295ee2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions container-storage-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -831,15 +831,15 @@ disable_auto_pool_extension() {
}


# Gets the current DOCKER_STORAGE_OPTIONS= string.
get_docker_storage_options() {
# Gets the current $STORAGE_OPTIONS= string.
get_current_storage_options() {
local options

if [ ! -f "${STORAGE_OUT_FILE}" ];then
return 0
fi

if options=$(grep -e "^DOCKER_STORAGE_OPTIONS=" ${STORAGE_OUT_FILE} | sed 's/DOCKER_STORAGE_OPTIONS=//' | sed 's/^ *//' | sed 's/^"//' | sed 's/"$//');then
if options=$(grep -e "^${STORAGE_OPTIONS}=" ${STORAGE_OUT_FILE} | sed "s/${STORAGE_OPTIONS}=//" | sed 's/^ *//' | sed 's/^"//' | sed 's/"$//');then
echo $options
return 0
fi
Expand Down Expand Up @@ -1050,7 +1050,7 @@ setup_storage() {
fi

# Query and save current storage options
if ! CURRENT_STORAGE_OPTIONS=$(get_docker_storage_options); then
if ! CURRENT_STORAGE_OPTIONS=$(get_current_storage_options); then
return 1
fi

Expand Down

0 comments on commit 8295ee2

Please sign in to comment.