]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
config: Unset SCRATCH_DEV when deduced from SCRATCH_DEV_POOL
authorLukas Czerner <lczerner@redhat.com>
Tue, 8 Apr 2014 23:55:52 +0000 (09:55 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 8 Apr 2014 23:55:52 +0000 (09:55 +1000)
In the case that we already have sections in the config file we
have to make sure that we unset SCRATCH_DEV if it has been deduced from
the SCRATCH_DEV_POOL so that it does not complain about SCRATCH_DEV in
this case.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Tested-by: Filipe David Manana <fdmanana@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/config

index 6fa18e210f6ebb9527bda4608f4b47a72006dcd4..31638014442ae143cc91dcc222f89558b0d8f2ad 100644 (file)
@@ -372,10 +372,15 @@ get_next_config() {
        unset MOUNT_OPTIONS
        unset MKFS_OPTIONS
        unset FSCK_OPTIONS
+       # We might have deduced SCRATCH_DEV from the SCRATCH_DEV_POOL in the previous
+       # run, so we have to unset it now.
+       if [ "$SCRATCH_DEV_NOT_SET" == "true" ]; then
+               unset SCRATCH_DEV
+       fi
 
        parse_config_section $1
 
-       if [ -n "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then
+       if [ ! -z "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then
                [ -z "$MOUNT_OPTIONS" ] && _mount_opts
                [ -z "$MKFS_OPTIONS" ] && _mkfs_opts
                [ -z "$FSCK_OPTIONS" ] && _fsck_opts
@@ -423,6 +428,7 @@ get_next_config() {
                fi
                SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
                export SCRATCH_DEV
+               export SCRATCH_DEV_NOT_SET=true
        fi
 
        echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1