Make sure that we dont change data in argument, add deep_copy.
This commit is contained in:
parent
608cf8e96f
commit
b37536b5de
@ -19,6 +19,7 @@ require 'logger'
|
||||
require 'shellwords'
|
||||
|
||||
require 'astute/ext/exception'
|
||||
require 'astute/ext/deep_copy'
|
||||
require 'astute/config'
|
||||
require 'astute/logparser'
|
||||
require 'astute/orchestrator'
|
||||
|
@ -57,7 +57,7 @@ class Astute::DeploymentEngine::NailyFact < Astute::DeploymentEngine
|
||||
attrs_to_puppet['fixed_interface'] = get_fixed_interface(node)
|
||||
end
|
||||
|
||||
attrs_to_puppet.merge!(attrs)
|
||||
attrs_to_puppet.merge!(deep_copy(attrs))
|
||||
|
||||
attrs_to_puppet.each do |k, v|
|
||||
unless v.is_a?(String) || v.is_a?(Integer)
|
||||
|
18
lib/astute/ext/deep_copy.rb
Normal file
18
lib/astute/ext/deep_copy.rb
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
def deep_copy(data)
|
||||
Marshal.load(Marshal.dump(data))
|
||||
end
|
Loading…
Reference in New Issue
Block a user