From 7bb79093c207c0bcf7631b0e7493710c5cf81be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Wir=C3=A9n?= Date: Thu, 10 Dec 2015 22:53:06 +0100 Subject: [PATCH] Only considers local attributes when comparing state This should fix #1092 --- lib/ansible/modules/extras/system/zfs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/system/zfs.py b/lib/ansible/modules/extras/system/zfs.py index 459d9d5582e..fbea120eb04 100644 --- a/lib/ansible/modules/extras/system/zfs.py +++ b/lib/ansible/modules/extras/system/zfs.py @@ -176,9 +176,7 @@ class Zfs(object): def set_properties_if_changed(self): current_properties = self.get_current_properties() for prop, value in self.properties.iteritems(): - if prop not in current_properties: - self.module.fail_json(msg="invalid property '%s'" % prop) - if current_properties[prop] != value: + if current_properties.get(prop, None) != value: self.set_property(prop, value) def get_current_properties(self): @@ -188,8 +186,9 @@ class Zfs(object): cmd += ['all', self.name] rc, out, err = self.module.run_command(" ".join(cmd)) properties = dict() - for p, v in [l.split('\t')[1:3] for l in out.splitlines()]: - properties[p] = v + for prop, value, source in [l.split('\t')[1:4] for l in out.splitlines()]: + if source == 'local': + properties[prop] = value # Add alias for enhanced sharing properties properties['sharenfs'] = properties.get('share.nfs', None) properties['sharesmb'] = properties.get('share.smb', None)