ini_setting: Skip transformer if value is not changed

... so that we can create a resource with value = nil and no
transformers.

This is required to fix the problem with puppet-swift which requires
to manage sections without any values.

Change-Id: I7ece6da0e16b275faf4120baf0ff68970491dc9d
This commit is contained in:
Takashi Kajinami
2022-07-10 19:09:02 +09:00
parent 0f5dcbc909
commit 12eae84da1

View File

@@ -20,7 +20,10 @@ Puppet::Type.type(:openstack_config).provide(
end
def create
resource[:value] = transform(:to, resource[:value])
new_value = transform(:to, resource[:value])
if resource[:value] != new_value
resource[:value] = new_value
end
super
end