fix(syncoid): Regression: `zfs get` parser not compatible with fallback

In the fallback mode, non-snapshot datasets would be included in the
output, leading to this parsing error:

```shell
# syncoid --debug root@192.168.122.26:rpool/before syncoid-test-11/after
… [TRUNCATED] …
WARNING: snapshot listing failed, trying fallback command
DEBUG: getting list of snapshots on rpool/before using ssh      -S   /tmp/syncoid-root19216812226-1718239740-763496-6973 root@192.168.122.26  zfs get -Hpd 1 all ''"'"'rpool/before'"'"'' |...
CRITICAL ERROR: Unexpected dataset format in rpool/before       type    filesystem      - at /usr/sbin/syncoid line 1914.
```

Fixes:
https://github.com/jimsalterjrs/sanoid/pull/818#issuecomment-2164155867
This commit is contained in:
Nick Liu 2024-06-12 20:05:47 -05:00
parent f16c15c9ba
commit a2adaf8499
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637
1 changed files with 1 additions and 1 deletions

View File

@ -1911,7 +1911,7 @@ sub getsnaps {
die "CRITICAL ERROR: Unexpected line format in $line" unless defined $value;
my (undef, $snap) = split /@/, $dataset;
die "CRITICAL ERROR: Unexpected dataset format in $line" unless $snap;
next unless length $snap;
if (!snapisincluded($snap)) { next; }