diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-22 13:57:12 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-22 13:57:12 +0200 |
commit | 3d7b436102772e5e9e146e45e8d52210ce7498b5 (patch) | |
tree | 7ba7a5ac6427ced9d9fb7dee2a2d06d17fe925b9 | |
parent | 858aba69d158c77502c879c8db3be6e811b0150d (diff) | |
download | postgresql-setup-tests-3d7b436102772e5e9e146e45e8d52210ce7498b5.tar.gz postgresql-setup-tests-3d7b436102772e5e9e146e45e8d52210ce7498b5.tar.xz postgresql-setup-tests-3d7b436102772e5e9e146e45e8d52210ce7498b5.zip |
controller/get_machine: allow specifying name of VM
* get_machine: New option --name and variable $opt_name.
-rwxr-xr-x | controller/get_machine | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/controller/get_machine b/controller/get_machine index 7d4e619..7121114 100755 --- a/controller/get_machine +++ b/controller/get_machine @@ -18,6 +18,7 @@ Options: --distro=NAME Distro name, like fedora --distro-version=VERSION E.g. 20 for Fedora 20 --openstack-instance=ID + --name=NAME Name of the machine EOHELP test -n "$1" && exit "$1" } @@ -42,14 +43,14 @@ get_ip() ) -longopts="distro:,distro-version:,openstack-instance:" +longopts="distro:,distro-version:,openstack-instance:,name:" ARGS=$(getopt -o "" -l "help,$longopts" -n "$0" -- "$@") \ || exit 1 eval set -- "$ARGS" while true; do case "$1" in - --distro|--distro-version|--openstack-instance) + --distro|--distro-version|--openstack-instance|--name) opt=$(sed -e 's/^--//' -e 's/[^[a-zA-Z0-9]/_/g'<<<"$1") eval "opt_$opt=\"${2,,}\"" shift 2 @@ -74,10 +75,11 @@ flavor=${os_flavor_ids[$image_version]} test -z "$image" && die "no image for '$image_version'" test -z "$flavor" && die "no flavor for '$image_version'" +test -z "$opt_name" && opt_name="testing-$image" info "booting machine $image_version from $image" -machine=$(boot "testing-$image" "$image" "$flavor") +machine=$(boot "$opt_name" "$image" "$flavor") info "machine id: $machine" |