Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALLOW SETTING EMPTY LVMEXTENSION #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

arjunkc
Copy link

@arjunkc arjunkc commented May 28, 2017

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