From 662b026b8d7176540d7df1091133b6f65c381017 Mon Sep 17 00:00:00 2001 From: "Vladmir Sharhsov(warpc)" Date: Fri, 20 Sep 2013 11:25:45 +0400 Subject: [PATCH] Create group of facts as one big fact in yaml format --- .rspec | 1 + lib/astute/deployment_engine/nailyfact.rb | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.rspec b/.rspec index f55b0caa..56bdc418 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,3 @@ --color -f d +#--profile diff --git a/lib/astute/deployment_engine/nailyfact.rb b/lib/astute/deployment_engine/nailyfact.rb index 86a6efa7..d79e071d 100644 --- a/lib/astute/deployment_engine/nailyfact.rb +++ b/lib/astute/deployment_engine/nailyfact.rb @@ -12,20 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. -require 'json' +require 'yaml' class Astute::DeploymentEngine::NailyFact < Astute::DeploymentEngine # Just merge attributes of concrete node # with attributes of cluster def create_facts(node_attrs) - facts = deep_copy(node_attrs) - - facts.each do |k, v| - facts[k] = v.to_json if v.is_a?(Hash) || v.is_a?(Array) - end - - facts + {'settings' => node_attrs.to_yaml} end def deploy_piece(nodes, retries=2, change_node_status=true)