Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge "Fix the help output for tripleo-mount-image"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Oct 21, 2021
2 parents 8700e43 + 6579b68 commit 7e89423
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/tripleo-mount-image
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#

set -eu
set -x
set -o pipefail
SCRIPT_NAME=$(basename $0)
NBD_DEVICE=/dev/nbd0
IMAGE_FILE=""
MOUNT_DIR=""
if [ ! -a "${NBD_DEVICE}" ]; then
modprobe nbd
fi
Expand Down Expand Up @@ -167,7 +168,7 @@ unmount_image() {


if [ $SCRIPT_NAME == "tripleo-unmount-image" ]; then
TEMP=`getopt -o hm:n: -n $SCRIPT_NAME -- "$@"`
TEMP=`getopt -o hm:n: -l help -n $SCRIPT_NAME -- "$@"`
if [ $? != 0 ]; then
echo "Terminating..." >&2
exit 1
Expand All @@ -183,9 +184,12 @@ if [ $SCRIPT_NAME == "tripleo-unmount-image" ]; then
*) echo "Error: unsupported option $1." ; exit 1;;
esac
done
if [ -z "${MOUNT_DIR}" ]; then
unmount_show_options 1
fi
unmount_image
else
TEMP=`getopt -o ha:m:n: -n $SCRIPT_NAME -- "$@"`
TEMP=`getopt -o ha:m:n: -l help -n $SCRIPT_NAME -- "$@"`
if [ $? != 0 ]; then
echo "Terminating..." >&2
exit 1
Expand All @@ -203,5 +207,8 @@ else
*) echo "Error: unsupported option $1." ; exit 1;;
esac
done
if [ -z "${MOUNT_DIR}" ] || [ -z "${IMAGE_FILE}"]; then
mount_show_options 1
fi
mount_image
fi

0 comments on commit 7e89423

Please sign in to comment.