zfs: fix property handling and map '-' as PropertySource.NONE

main
svalouch 5 years ago
parent 0c750dc6eb
commit 02bf446a18

@ -132,7 +132,7 @@ class PropertySource(str, Enum):
return PropertySource.TEMPORARY
elif val == 'received':
return PropertySource.RECEIVED
elif val == 'none':
elif val == 'none' or val == '-':
return PropertySource.NONE
else:
raise ValueError(f'Value {value} is not a valid PropertySource')

@ -486,7 +486,7 @@ class ZFS:
# check the syntax of the properties
if properties is not None:
for k, v in properties:
for k, v in properties.items():
validate_native_property_name(k)
validate_property_value(v)

Loading…
Cancel
Save