From e8e09257400d5b0809a593272e25d15b7fa91f40 Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Fri, 5 Jun 2015 18:46:07 +0300 Subject: [PATCH] Do not create and destroy Sahara templates if exists Validation error in Sahara is occurred during scaling cluster (add one more controller), when some Sahara template in use. So, do not destroy Sahara templates. Also, do not recreate template if exists. Change-Id: I629046b70d93d3c040bc104270254f11a07c91a3 Closes-bug: #1462422 --- .../sahara/lib/puppet/provider/sahara_cluster_template/ruby.rb | 3 +-- .../lib/puppet/provider/sahara_node_group_template/ruby.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/deployment/puppet/sahara/lib/puppet/provider/sahara_cluster_template/ruby.rb b/deployment/puppet/sahara/lib/puppet/provider/sahara_cluster_template/ruby.rb index b416f91158..ff0f9abbc9 100644 --- a/deployment/puppet/sahara/lib/puppet/provider/sahara_cluster_template/ruby.rb +++ b/deployment/puppet/sahara/lib/puppet/provider/sahara_cluster_template/ruby.rb @@ -179,8 +179,7 @@ Puppet::Type.type(:sahara_cluster_template).provide(:ruby) do node_group['count'] = node_group['count'].to_i if node_group['count'] end if present? - destroy if @property_hash[:id] - connection.create_cluster_template options + connection.create_cluster_template options unless @property_hash[:id] end end diff --git a/deployment/puppet/sahara/lib/puppet/provider/sahara_node_group_template/ruby.rb b/deployment/puppet/sahara/lib/puppet/provider/sahara_node_group_template/ruby.rb index 13ef813115..ae5f8ec2d2 100644 --- a/deployment/puppet/sahara/lib/puppet/provider/sahara_node_group_template/ruby.rb +++ b/deployment/puppet/sahara/lib/puppet/provider/sahara_node_group_template/ruby.rb @@ -209,8 +209,7 @@ Puppet::Type.type(:sahara_node_group_template).provide(:ruby) do debug 'Call: flush' options = @property_hash.reject { |k, v| [:id, :ensure].include? k } if present? - destroy if @property_hash[:id] - connection.create_node_group_template options + connection.create_node_group_template options unless @property_hash[:id] end end