From 5b9ac8c357622b0968751f35e11ca18b87cee14e Mon Sep 17 00:00:00 2001 From: Sergey Vasilenko Date: Tue, 30 Jun 2015 15:37:13 +0300 Subject: [PATCH] Fix get_nodes_hash_by_roles parser function for using 'node_roles' list Change-Id: I1f1ffd154f1d5f3d6af8f1097400db88393df28d blueprint: templates-for-networking --- .../lib/puppet/parser/functions/get_nodes_hash_by_roles.rb | 2 +- .../spec/functions/get_nodes_hash_by_roles__spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/get_nodes_hash_by_roles.rb b/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/get_nodes_hash_by_roles.rb index 3c253025fe..7f20ab8c93 100644 --- a/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/get_nodes_hash_by_roles.rb +++ b/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/get_nodes_hash_by_roles.rb @@ -12,7 +12,7 @@ EOS raise(Puppet::ParseError, "#{errmsg}: 2nd argument should be an list of roles") if !roles.is_a?(Array) nodes = n_metadata['nodes'] nodes.reject do |node_name| - (roles & nodes[node_name]['network_roles']).empty? + (roles & nodes[node_name]['node_roles']).empty? end end end diff --git a/deployment/puppet/osnailyfacter/spec/functions/get_nodes_hash_by_roles__spec.rb b/deployment/puppet/osnailyfacter/spec/functions/get_nodes_hash_by_roles__spec.rb index d7b1d57d33..804bd97330 100644 --- a/deployment/puppet/osnailyfacter/spec/functions/get_nodes_hash_by_roles__spec.rb +++ b/deployment/puppet/osnailyfacter/spec/functions/get_nodes_hash_by_roles__spec.rb @@ -7,18 +7,18 @@ YAML.load(" --- nodes: node-55: - network_roles: + node_roles: - controller - mongo - cinder node-66: - network_roles: + node_roles: - compute - cinder - xxx - yyy node-77: - network_roles: + node_roles: - mongo - cinder - xxx