diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-12-13 18:54:21 -0700 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-12-13 18:54:21 -0700 |
| commit | 32086f62131e1b813e2f3d97bc2c78f66c6a3154 (patch) | |
| tree | 2005059011aea64121af64de5b3567fd0dcbca3b /files/flavor.sh | |
| parent | 21fa10807bb475bff42a997ac4add3cc7e6346f9 (diff) | |
adding files
Diffstat (limited to 'files/flavor.sh')
| -rwxr-xr-x | files/flavor.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/files/flavor.sh b/files/flavor.sh new file mode 100755 index 0000000..c391b18 --- /dev/null +++ b/files/flavor.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +flavor_name="${1}" + +if [ "${flavor_name}" == "" ]; then + echo "No flavor name supplied." >&2 + exit 1 +fi + +flavor_id=$(nova flavor-list | grep -F "${flavor_name}" | awk '{print $2;}') +if [ "${flavor_id}" == "" ]; then + echo -n "Cannot retrieve a flavor ID corresponding to the name: " >&2 + echo "${flavor_name}" >&2 + exit 1 +fi + +exit 0 |
