oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
608 stars 138 forks source link

fix znapzend dataset discovery without arguments #450

Closed lotheac closed 4 years ago

lotheac commented 4 years ago

In master, znapzend without arguments fails as follows:

% znapzend -d
=== getDataSetProperties():
        recurse=$VAR1 = 1;

        inherit=$VAR1 = 0;

        DS=$VAR1 = [
          ''
        ];

        lowmemRecurse=0
=== getDataSetProperties(): Is array...
=== getDataSetProperties(): Looking under '' with '1' recursion mode and '0' inheritance mode
# zfs get -H -s local -t filesystem,volume -r -o name,property,value,source all
cannot open '': empty component in name
=== getDataSetProperties():
        Collected:
=== getBackupSet() : got 0 dataset(s) with a local backup plan
No backup set defined or enabled, yet. run 'znapzendzetup' to setup znapzend

this happens because the zfs command is passed an empty string as an extra argument (see DS= in the debug output). So make sure that doesn't happen by default.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 89.822% when pulling 86363addc3a706f2270ad337f1d8e476024fec4c on lotheac:master into b8c66eca3e60c11437c8752b44d4d8bdf9988faa on oetiker:master.

jimklimov commented 4 years ago

Curious, I'm sure I tested this at some point in development... maybe not at the latest point though. Sorry for the mess-up and thanks for taking care of it :-)