Skip to content

ALLOW SETTING EMPTY LVMEXTENSION#3

Open
arjunkc wants to merge 1 commit into
maff:masterfrom
arjunkc:master
Open

ALLOW SETTING EMPTY LVMEXTENSION#3
arjunkc wants to merge 1 commit into
maff:masterfrom
arjunkc:master

Conversation

@arjunkc

@arjunkc arjunkc commented May 28, 2017

Copy link
Copy Markdown

The variable LVMEXTENSION is set by default to something like "-disk". If you
attempt to set an empty LVMEXTENSION using

lvmsnapshot -e "" create <lvname>

Then the variable OPT_LVMEXTENSION will be empty when the command-line arguments are
parsed. This means that the following test will fail

if [ ! -z $OPT_LVMEXTENSION ]; then

and LVMEXTENSION will continue to contain its default value. So I added an extra
flag that ISSET_OPT_LVMEXTENSION to show that the argument was parsed. This
allows for an empty LVMEXTENSION to be set using

-e ""

The variable LVMEXTENSION is set by default to something like "-disk". If you
attempt to set an empty LVMEXTENSION using

    lvmsnapshot -e "" create <lvname>

Then the variable OPT_LVMEXTENSION will be empty when the command-line arguments are
parsed. This means that the following test will fail

    if [ ! -z $OPT_LVMEXTENSION ]; then

and LVMEXTENSION will continue to contain its default value. So I added an extra
flag that ISSET_OPT_LVMEXTENSION to show that the argument was parsed. This
allows for an empty LVMEXTENSION to be set using

    -e ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant