You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use snapshots_serialized and the only property in the list is createtxg, py-libzfs will not fetch it correctly. Instead of the usual parsed, source, rawvalue, value dict, it will simply return 0. However, if there are any other properties in the list, then all will be fetched correctly. From my spot-checking, only createtxg exhibits this behavior.
Environment
FreeBSD 13.1-RELEASE amd64, py-libzfs-1.1.2023020200. The bug must've been introduced sometime in the revision range 077cf6d..1a99a45.
Steps to Reproduce
Ensure that there is a dataset named "tank" with at least one snapshot. Then run this script:
frompprintimportpprintimportlibzfszfs=libzfs.ZFS()
badsnaps=zfs.snapshots_serialized(
props=["createtxg"],
datasets=["tank"],
recursive=False
)
goodsnaps=zfs.snapshots_serialized(
props=["used", "createtxg"],
datasets=["tank"],
recursive=False
)
print("Bad version of the snapshot list:")
pprint(badsnaps[0])
print("\nGood version of the snapshot list:")
pprint(goodsnaps[0])
The output will look like this:
Bad version of the snapshot list:
{'createtxg': '0', <--- Incorrect value
'dataset': 'tank',
'id': 'tank@zrepl_20230119_070154_000',
'name': 'tank@zrepl_20230119_070154_000',
'pool': 'tank',
'snapshot_name': 'zrepl_20230119_070154_000',
'type': 'SNAPSHOT'} <--- Dict ends with no 'properties' section
Good version of the snapshot list:
{'createtxg': '53209141', <--- Correct value
'dataset': 'tank',
'id': 'tank@zrepl_20230119_070154_000',
'name': 'tank@zrepl_20230119_070154_000',
'pool': 'tank',
'properties': {'createtxg': {'parsed': '53209141', <--- Expected 'properties' section
'rawvalue': '53209141',
'source': 'NONE',
'value': '53209141'},
'used': {'parsed': 0,
'rawvalue': '0',
'source': 'NONE',
'value': '0B'}},
'snapshot_name': 'zrepl_20230119_070154_000',
'type': 'SNAPSHOT'}
The text was updated successfully, but these errors were encountered:
If you use
snapshots_serialized
and the only property in the list iscreatetxg
, py-libzfs will not fetch it correctly. Instead of the usualparsed
,source
,rawvalue
,value
dict, it will simply return0
. However, if there are any other properties in the list, then all will be fetched correctly. From my spot-checking, only createtxg exhibits this behavior.Environment
FreeBSD 13.1-RELEASE amd64, py-libzfs-1.1.2023020200. The bug must've been introduced sometime in the revision range 077cf6d..1a99a45.
Steps to Reproduce
Ensure that there is a dataset named "tank" with at least one snapshot. Then run this script:
The output will look like this:
The text was updated successfully, but these errors were encountered: