 a8947b5bf3
			
		
	
	a8947b5bf3
	
	
	
		
			
			- Switch to Stein release - Cookstyle fixes - Update cookbook etcd to ~> 5.6 - Update README - Add myself to author list and OSU Copyright - Properly fix completions recipe and ensure it works - Create and start the etcd service in the etcd recipe - Update delivery configuration to exclude integration cookbooks - Refactor and update RenderConfigFileMatcher to work with newer ChefSpec. This fixes output which was passing but showing error messages. Depends-On: https://review.opendev.org/701027 Change-Id: Iba3eeabe85ab9303147e43eeb550212a46d190f3
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # encoding: UTF-8
 | |
| 
 | |
| #
 | |
| # Cookbook:: openstack-common
 | |
| # library:: config_helpers
 | |
| #
 | |
| # Copyright:: 2016, cloudbau GmbH
 | |
| #
 | |
| # 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.
 | |
| #
 | |
| 
 | |
| # config helper methods
 | |
| module ::Openstack
 | |
|   # return a Mash with config options which can be used for the service config
 | |
|   # templates
 | |
|   # @param [String] service
 | |
|   def merge_config_options(service)
 | |
|     conf = deep_dup(node['openstack'][service]['conf'])
 | |
|     conf_secrets = if node['openstack'][service]['conf_secrets']
 | |
|                      deep_dup(node['openstack'][service]['conf_secrets'])
 | |
|                    else
 | |
|                      {}
 | |
|                    end
 | |
|     Chef::Mixin::DeepMerge.merge(conf, conf_secrets)
 | |
|   end
 | |
| 
 | |
|   # return a full dup of the given Mash even if nested
 | |
|   # @param kind_of(Mash) can be a Chef::Node::ImmutableMash and will output a
 | |
|   # simple Mash on all layers
 | |
|   def deep_dup(mash)
 | |
|     duplicate = mash.dup
 | |
|     duplicate.each_pair do |k, v|
 | |
|       tv = duplicate[k]
 | |
|       duplicate[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? deep_dup(tv) : v
 | |
|     end
 | |
|     duplicate
 | |
|   end
 | |
| end
 |