From 38d0a27c661da859b95cc6e290e3f534cb2ad7e7 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sat, 23 May 2020 14:31:00 -0700 Subject: [PATCH] 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 --- .rubocop.yml | 14 -------------- README.rst | 6 +++--- Rakefile | 16 ++++++++-------- metadata.rb | 6 +++--- recipes/openstack-db.rb | 2 +- 5 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 8d19f13..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,14 +0,0 @@ -AllCops: - Include: - - metadata.rb - - Gemfile - - attributes/** - - libraries/** - - providers/** - - recipes/** - - resources/** - - spec/** - Exclude: - - .cookbooks/**/* - - berks-cookbooks/**/* - - .bundle/**/* diff --git a/README.rst b/README.rst index 0586c14..af58164 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ Requirements ============ - 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) Platforms @@ -30,8 +30,8 @@ Cookbooks The following cookbooks are dependencies: -- 'mariadb', '~> 3.1' -- 'openstack-common', '~> 19.0.0' +- 'mariadb', '~> 4.0' +- 'openstack-common', '~> 20.0.0' Usage ===== diff --git a/Rakefile b/Rakefile index f6ed86b..6ec521b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,28 +1,28 @@ -task default: ["test"] +task default: ['test'] task test: [:syntax, :lint, :unit] -desc "Vendor the cookbooks in the Berksfile" +desc 'Vendor the cookbooks in the Berksfile' task :berks_prep do sh %(chef exec berks vendor) end -desc "Run FoodCritic (syntax) tests" +desc 'Run FoodCritic (syntax) tests' task :syntax do sh %(chef exec foodcritic --exclude spec -f any .) end -desc "Run RuboCop (lint) tests" +desc 'Run RuboCop (lint) tests' task :lint do sh %(chef exec cookstyle) end -desc "Run RSpec (unit) tests" +desc 'Run RSpec (unit) tests' task unit: :berks_prep do sh %(chef exec rspec --format documentation) end -desc "Remove the berks-cookbooks directory and the Berksfile.lock" +desc 'Remove the berks-cookbooks directory and the Berksfile.lock' task :clean do rm_rf [ 'berks-cookbooks', @@ -30,10 +30,10 @@ task :clean do ] end -desc "All-in-One Neutron build Infra using Common task" +desc 'All-in-One Neutron build Infra using Common task' task :integration do # Use the common integration task sh %(wget -nv -t 3 -O Rakefile-Common https://opendev.org/openstack/cookbook-openstack-common/raw/branch/master/Rakefile) load './Rakefile-Common' - Rake::Task["common_integration"].invoke + Rake::Task['common_integration'].invoke end diff --git a/metadata.rb b/metadata.rb index 2b49e98..97753a6 100755 --- a/metadata.rb +++ b/metadata.rb @@ -3,15 +3,15 @@ maintainer 'openstack-chef' maintainer_email 'openstack-discuss@lists.openstack.org' license 'Apache-2.0' description 'Provides the shared database configuration for OpenStack' -version '19.0.0' +version '20.0.0' %w(ubuntu redhat centos).each do |os| supports os 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' source_url 'https://opendev.org/openstack/cookbook-openstack-ops-database' diff --git a/recipes/openstack-db.rb b/recipes/openstack-db.rb index 783db55..2a68e9e 100644 --- a/recipes/openstack-db.rb +++ b/recipes/openstack-db.rb @@ -34,6 +34,6 @@ node['openstack']['common']['services'].each do |service, project| pass password end 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