From 57042a006e998d4fc3095a5980558ffc0b67400c Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Fri, 1 Jul 2016 16:37:22 -0700 Subject: [PATCH] Style and lint fixes to support newer ChefDK Change-Id: I7b8521a85bace612911f967fe4e35269b7b47034 Depends-On: I6ce4587caa3ae68ddbd3ef1a521aaf46f4840b2c --- .rubocop.yml | 3 +++ README.md | 2 +- metadata.rb | 2 ++ recipes/mariadb-server.rb | 11 ++++++----- recipes/mysql-server.rb | 10 +++++----- recipes/postgresql-server.rb | 10 +++++----- spec/spec_helper.rb | 4 ++-- 7 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 5e0be9f..2f2a2f5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -23,6 +23,9 @@ Encoding: NumericLiterals: Enabled: false +StringLiterals: + Enabled: false + LineLength: Enabled: false diff --git a/README.md b/README.md index 7349ba9..b5f0b14 100644 --- a/README.md +++ b/README.md @@ -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 # diff --git a/metadata.rb b/metadata.rb index a5c4fe1..b707940 100755 --- a/metadata.rb +++ b/metadata.rb @@ -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' diff --git a/recipes/mariadb-server.rb b/recipes/mariadb-server.rb index 6120e5e..eb3d973 100644 --- a/recipes/mariadb-server.rb +++ b/recipes/mariadb-server.rb @@ -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'] diff --git a/recipes/mysql-server.rb b/recipes/mysql-server.rb index d692cd4..249194c 100644 --- a/recipes/mysql-server.rb +++ b/recipes/mysql-server.rb @@ -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'] diff --git a/recipes/postgresql-server.rb b/recipes/postgresql-server.rb index 7ab387c..e9929c9 100644 --- a/recipes/postgresql-server.rb +++ b/recipes/postgresql-server.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 62dce8f..f2b1554 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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