Merge pull request #47227 from pruiz/pruiz/zfs-dataset-present-slow-2017.7

Fix issue #47225: avoid zfs.filesystem_present slowdown when dataset has lots of snapshots (2017.7 branch)
This commit is contained in:
Nicole Thomas 2018-04-23 10:05:57 -04:00 committed by GitHub
commit 56933eb0b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,7 +376,7 @@ def filesystem_present(name, create_parent=False, properties=None, cloned_from=N
if name in __salt__['zfs.list'](name, **{'type': 'filesystem'}): # update properties if needed
result = {}
if len(properties) > 0:
result = __salt__['zfs.get'](name, **{'properties': ','.join(properties.keys()), 'fields': 'value', 'depth': 1})
result = __salt__['zfs.get'](name, **{'properties': ','.join(properties.keys()), 'type': 'filesystem', 'fields': 'value', 'depth': 0})
for prop in properties:
if properties[prop] != result[name][prop]['value']: