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 return PropertySource.TEMPORARY
elif val == 'received': elif val == 'received':
return PropertySource.RECEIVED return PropertySource.RECEIVED
elif val == 'none': elif val == 'none' or val == '-':
return PropertySource.NONE return PropertySource.NONE
else: else:
raise ValueError(f'Value {value} is not a valid PropertySource') raise ValueError(f'Value {value} is not a valid PropertySource')

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

Loading…
Cancel
Save