diff options
author | Anoop C S <anoopcs@redhat.com> | 2017-10-19 13:40:35 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-10-30 15:49:02 +0000 |
commit | 39ac511a5d6dbc141bb3e1d8b4b4b8922c71b5a4 (patch) | |
tree | 3ee8da099f6c511d8abeccebbf7546b2f5c8a787 /extras/hook-scripts/add-brick | |
parent | 9aa574a51b84717c1f3949ed2e28a49e49840a93 (diff) |
extras/hooks: Fix getopt usage
`getopt` does not have an optional argument as '-name'. It should
be either '-n' or '--name'(see man getopt(1)). This wrong usage
resulted in setting the script name as 'ame' instead of $PROGNAME
in most of the hook-scripts.
Additionally the following line from DESCRIPTION given for `getopt`
shell command expects short options for almost every kind of usage
mentioned in SYNOPSIS:
. . .
If no '-o' or '--options' option is found in the first part, the
first parameter of the second part is used as the short options string.
. . .
Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more
clarity on its usage.
Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce
BUG: 1503983
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Diffstat (limited to 'extras/hook-scripts/add-brick')
-rwxr-xr-x | extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh | 2 | ||||
-rwxr-xr-x | extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh index 1b9237cac01..c371ef58b3e 100755 --- a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh +++ b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh @@ -74,7 +74,7 @@ get_and_set_xattr () ##------------------------------------------ ## Parse the arguments ##------------------------------------------ -ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@") +ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@") eval set -- "$ARGS" while true; diff --git a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh index d8f14b5a12c..27e85231f45 100755 --- a/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh +++ b/extras/hook-scripts/add-brick/pre/S28Quota-enable-root-xattr-heal.sh @@ -38,7 +38,7 @@ activate () ##------------------------------------------ ## Parse the arguments ##------------------------------------------ -ARGS=$(getopt -l $OPTSPEC -name $PROGNAME "$@") +ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@") eval set -- "$ARGS" while true; |