Revision 4d88c6cf
b/snf-image-host/common.sh.in | ||
---|---|---|
162 | 162 |
get_api20_arguments() { |
163 | 163 |
get_api10_arguments |
164 | 164 |
|
165 |
local required_osparams="IMG_ID IMG_FORMAT IMG_PASSWD" |
|
166 |
local osparams="$required_osparams IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL" |
|
165 |
if [ "$SCRIPT_NAME" = "create" ]; then |
|
166 |
local required_osparams="IMG_ID IMG_FORMAT IMG_PASSWD" |
|
167 |
local osparams="$required_osparams IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL" |
|
167 | 168 |
|
168 |
# Store OSP_VAR in VAR |
|
169 |
for param in $osparams; do |
|
170 |
eval $param=\"\$OSP_$param\" |
|
171 |
done |
|
172 |
|
|
173 |
if [ -n "$CONFIG_URL" ]; then |
|
174 |
local config config_params |
|
175 |
echo "Downloading configuration parameters from: \`$CONFIG_URL'" >&2 |
|
176 |
config=$($CURL -f "$CONFIG_URL") |
|
177 |
config_params=$(./decode-config.py $osparams <<< "$config") |
|
178 |
eval "$config_params" |
|
179 |
fi |
|
169 |
# Store OSP_VAR in VAR |
|
170 |
for param in $osparams; do |
|
171 |
eval $param=\"\$OSP_$param\" |
|
172 |
done |
|
180 | 173 |
|
181 |
for var in $required_osparams; do |
|
182 |
if [ -z "${!var}" ]; then |
|
183 |
log_error "Missing OS API Parameter: ${var}" |
|
184 |
exit 1 |
|
174 |
if [ -n "$CONFIG_URL" ]; then |
|
175 |
local config config_params |
|
176 |
echo "Downloading configuration parameters from: \`$CONFIG_URL'" >&2 |
|
177 |
config=$($CURL -f "$CONFIG_URL") |
|
178 |
config_params=$(./decode-config.py $osparams <<< "$config") |
|
179 |
eval "$config_params" |
|
185 | 180 |
fi |
186 |
done |
|
181 |
|
|
182 |
for var in $required_osparams; do |
|
183 |
if [ -z "${!var}" ]; then |
|
184 |
log_error "Missing OS API Parameter: ${var}" |
|
185 |
exit 1 |
|
186 |
fi |
|
187 |
done |
|
188 |
fi |
|
187 | 189 |
} |
188 | 190 |
|
189 | 191 |
map_disk0() { |
Also available in: Unified diff