Updates for Train

Changed:
- Update release to train
- Update to mariadb ~> 4.0

Fixed:
- Migrate to using Chef::Log.warn instead of the log resource to fix
  idempotency issues.
- Cookstyle

Removed:
- Unused .rubocop.yml

Depends-On: https://review.opendev.org/731851
Change-Id: Ia705cf4fb00098ba5d34f22268c0e409b82580a0
This commit is contained in:
Lance Albertson 2020-05-23 14:31:00 -07:00
parent 601c814995
commit 38d0a27c66
5 changed files with 15 additions and 29 deletions

View File

@ -1,14 +0,0 @@
AllCops:
Include:
- metadata.rb
- Gemfile
- attributes/**
- libraries/**
- providers/**
- recipes/**
- resources/**
- spec/**
Exclude:
- .cookbooks/**/*
- berks-cookbooks/**/*
- .bundle/**/*

View File

@ -15,7 +15,7 @@ Requirements
============ ============
- Chef 15 or higher - Chef 15 or higher
- Chef Workstation 0.15.18 for testing (also includes Berkshelf for cookbook - Chef Workstation 0.18.3 for testing (also includes Berkshelf for cookbook
dependency resolution) dependency resolution)
Platforms Platforms
@ -30,8 +30,8 @@ Cookbooks
The following cookbooks are dependencies: The following cookbooks are dependencies:
- 'mariadb', '~> 3.1' - 'mariadb', '~> 4.0'
- 'openstack-common', '~> 19.0.0' - 'openstack-common', '~> 20.0.0'
Usage Usage
===== =====

View File

@ -1,28 +1,28 @@
task default: ["test"] task default: ['test']
task test: [:syntax, :lint, :unit] task test: [:syntax, :lint, :unit]
desc "Vendor the cookbooks in the Berksfile" desc 'Vendor the cookbooks in the Berksfile'
task :berks_prep do task :berks_prep do
sh %(chef exec berks vendor) sh %(chef exec berks vendor)
end end
desc "Run FoodCritic (syntax) tests" desc 'Run FoodCritic (syntax) tests'
task :syntax do task :syntax do
sh %(chef exec foodcritic --exclude spec -f any .) sh %(chef exec foodcritic --exclude spec -f any .)
end end
desc "Run RuboCop (lint) tests" desc 'Run RuboCop (lint) tests'
task :lint do task :lint do
sh %(chef exec cookstyle) sh %(chef exec cookstyle)
end end
desc "Run RSpec (unit) tests" desc 'Run RSpec (unit) tests'
task unit: :berks_prep do task unit: :berks_prep do
sh %(chef exec rspec --format documentation) sh %(chef exec rspec --format documentation)
end end
desc "Remove the berks-cookbooks directory and the Berksfile.lock" desc 'Remove the berks-cookbooks directory and the Berksfile.lock'
task :clean do task :clean do
rm_rf [ rm_rf [
'berks-cookbooks', 'berks-cookbooks',
@ -30,10 +30,10 @@ task :clean do
] ]
end end
desc "All-in-One Neutron build Infra using Common task" desc 'All-in-One Neutron build Infra using Common task'
task :integration do task :integration do
# Use the common integration task # Use the common integration task
sh %(wget -nv -t 3 -O Rakefile-Common https://opendev.org/openstack/cookbook-openstack-common/raw/branch/master/Rakefile) sh %(wget -nv -t 3 -O Rakefile-Common https://opendev.org/openstack/cookbook-openstack-common/raw/branch/master/Rakefile)
load './Rakefile-Common' load './Rakefile-Common'
Rake::Task["common_integration"].invoke Rake::Task['common_integration'].invoke
end end

View File

@ -3,15 +3,15 @@ maintainer 'openstack-chef'
maintainer_email 'openstack-discuss@lists.openstack.org' maintainer_email 'openstack-discuss@lists.openstack.org'
license 'Apache-2.0' license 'Apache-2.0'
description 'Provides the shared database configuration for OpenStack' description 'Provides the shared database configuration for OpenStack'
version '19.0.0' version '20.0.0'
%w(ubuntu redhat centos).each do |os| %w(ubuntu redhat centos).each do |os|
supports os supports os
end end
depends 'openstack-common', '>= 19.0.0' depends 'openstack-common', '>= 20.0.0'
depends 'mariadb', '~> 3.1' depends 'mariadb', '~> 4.0'
issues_url 'https://launchpad.net/openstack-chef' issues_url 'https://launchpad.net/openstack-chef'
source_url 'https://opendev.org/openstack/cookbook-openstack-ops-database' source_url 'https://opendev.org/openstack/cookbook-openstack-ops-database'

View File

@ -34,6 +34,6 @@ node['openstack']['common']['services'].each do |service, project|
pass password pass password
end end
rescue Net::HTTPServerException, ChefVault::Exceptions::KeysNotFound rescue Net::HTTPServerException, ChefVault::Exceptions::KeysNotFound
log "No databag item containing the database password for #{project} was found, so no database was created" Chef::Log.warn("No databag item containing the database password for #{project} was found, so no database was created")
end end
end end