Munge weights to be in the format %.2f

The swift ring db converts integers into floats with 2 decimal
points percisions. This was causing the ring resources to constantly
resync.

This commit munges weight in the type to the proper format.
This commit is contained in:
Dan 2012-03-14 05:41:41 +00:00
parent d7698139fe
commit f93ba72fbb
3 changed files with 15 additions and 3 deletions

View File

@ -15,7 +15,11 @@ Puppet::Type.newtype(:ring_account_device) do
newproperty(:device_name)
newproperty(:weight)
newproperty(:weight) do
munge do |value|
"%.2f" % value
end
end
newproperty(:meta)

View File

@ -15,7 +15,11 @@ Puppet::Type.newtype(:ring_container_device) do
newproperty(:device_name)
newproperty(:weight)
newproperty(:weight) do
munge do |value|
"%.2f" % value
end
end
newproperty(:meta)

View File

@ -15,7 +15,11 @@ Puppet::Type.newtype(:ring_object_device) do
newproperty(:device_name)
newproperty(:weight)
newproperty(:weight) do
munge do |value|
"%.2f" % value
end
end
newproperty(:meta)