mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 14:11:07 +02:00
release_util: use BOTO_PATH instead of searching for .boto
This simplifies the code a little and allows BOTO_PATH or BOTO_CONFIG to be set in the environment. Now configs may be in arbitrary locations.
This commit is contained in:
parent
851cf98945
commit
9332cb697e
@ -56,17 +56,10 @@ check_gsutil_opts() {
|
|||||||
UPLOAD_PATH="${FLAGS_upload_path%%/}"
|
UPLOAD_PATH="${FLAGS_upload_path%%/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Search for .boto, may be run via sudo
|
# Ensure scripts run via sudo can use the user's gsutil/boto configuration.
|
||||||
local boto
|
if [[ -n "${SUDO_USER}" ]]; then
|
||||||
for boto in "$HOME/.boto" "/home/$SUDO_USER/.boto"; do
|
: ${BOTO_PATH:="$HOME/.boto:/home/$SUDO_USER/.boto"}
|
||||||
if [[ -f "$boto" ]]; then
|
export BOTO_PATH
|
||||||
info "Using boto config $boto"
|
|
||||||
export BOTO_CONFIG="$boto"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [[ ! -f "$BOTO_CONFIG" ]]; then
|
|
||||||
die_notrace "Please run gsutil config to create ~/.boto"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user