Sort host_aggregate hosts list for comparison

Sort the list of hosts in the aggregate, both from the
provider/nova API as well as from the resource definition
in the manifest.  This allows for more accurate comparison
to determine if the resource really needs to be updated or
not.

Change-Id: I10a1995eb58e4bcd492bb7d6f94453a29cb31097
Closes-bug: 1534845
This commit is contained in:
Mike Dorman
2016-01-15 15:58:36 -07:00
parent 32fb6134c0
commit 2075c0fc9e
2 changed files with 2 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ Puppet::Type.type(:nova_aggregate).provide(
:id => attrs['Id'],
:availability_zone => attrs['Availability Zone'],
:metadata => attrs['Metadata'],
:hosts => attrs['Hosts']
:hosts => attrs['Hosts'].sort
)
end
end

View File

@@ -99,7 +99,7 @@ Puppet::Type.newtype(:nova_aggregate) do
desc 'Single host or comma seperated list of hosts'
#convert DSL/string form to internal form
munge do |value|
return value.split(",").map{|el| el.strip()}
return value.split(",").map{|el| el.strip()}.sort
end
end