summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontroller/get_machine8
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"