Style and lint fixes to support newer ChefDK

Change-Id: I7b8521a85bace612911f967fe4e35269b7b47034
Depends-On: I6ce4587caa3ae68ddbd3ef1a521aaf46f4840b2c
This commit is contained in:
Samuel Cassiba 2016-07-01 16:37:22 -07:00
parent 88b1e879f2
commit 57042a006e
7 changed files with 24 additions and 18 deletions

View File

@ -23,6 +23,9 @@ Encoding:
NumericLiterals:
Enabled: false
StringLiterals:
Enabled: false
LineLength:
Enabled: false

View File

@ -4,7 +4,7 @@ This cookbook provides a reference example of database configuration for the Ope
# Requirements #
Chef 11 with Ruby 1.9.x required.
ChefDK 0.15.15 with Ruby 2.1.x required.
# Platforms #

View File

@ -1,6 +1,8 @@
name 'openstack-ops-database'
maintainer 'openstack-chef'
maintainer_email 'openstack-dev@lists.openstack.org'
issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url)
source_url 'https://github.com/openstack/cookbook-openstack-ops-database' if respond_to?(:source_url)
license 'Apache 2.0'
description 'Provides the shared database configuration for Chef for OpenStack.'
version '14.0.0'

View File

@ -21,11 +21,12 @@ class ::Chef::Recipe # rubocop:disable Documentation
end
bind_db = node['openstack']['bind_service']['db']
if bind_db['interface']
listen_address = address_for bind_db['interface']
else
listen_address = bind_db['host']
end
listen_address = if bind_db['interface']
address_for bind_db['interface']
else
bind_db['host']
end
super_password = get_password 'db', node['openstack']['db']['root_user_key']

View File

@ -25,11 +25,11 @@ class ::Chef::Recipe # rubocop:disable Documentation
end
bind_db = node['openstack']['bind_service']['db']
if bind_db['interface']
listen_address = address_for bind_db['interface']
else
listen_address = bind_db['host']
end
listen_address = if bind_db['interface']
address_for bind_db['interface']
else
listen_address = bind_db['host']
end
super_password = get_password 'db', node['openstack']['db']['root_user_key']

View File

@ -26,11 +26,11 @@ class ::Chef::Recipe # rubocop:disable Documentation
end
bind_db = node['openstack']['bind_service']['db']
if bind_db['interface']
listen_address = address_for bind_db['interface']
else
listen_address = bind_db['host']
end
listen_address = if bind_db['interface']
address_for bind_db['interface']
else
bind_db['host']
end
node.override['postgresql']['config']['listen_addresses'] = listen_address

View File

@ -9,12 +9,12 @@ REDHAT_OPTS = {
platform: 'redhat',
version: '7.1',
log_level: ::LOG_LEVEL
}
}.freeze
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '14.04',
log_level: ::LOG_LEVEL
}
}.freeze
shared_context 'database-stubs' do
before do