Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHEF-1921 Fixed the knife-cloud verify test failure #180

Merged
merged 9 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@ expeditor:
timeout_in_minutes: 30

steps:
- label: run-specs-ruby-2.6
- label: run-specs-ruby-3.1
command:
- .expeditor/run_linux_tests.sh rake
expeditor:
executor:
docker:
image: ruby:2.6-buster
- label: run-specs-ruby-2.7
command:
- .expeditor/run_linux_tests.sh rake
expeditor:
executor:
docker:
image: ruby:2.7-buster
image: ruby:3.1
- label: run-specs-windows
command:
- bundle config --local path vendor/bundle
Expand All @@ -34,3 +27,4 @@ steps:
executor:
docker:
host_os: windows
image: rubydistros/windows-2019:3.1
14 changes: 10 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ end

group :test do
gem "rake"
gem "rspec-core"
gem "rspec-core", "~> 3.9"
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
gem "chef-zero", "~> 15"
gem "chef", "~> 15"
elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.1")
gem "chef-zero", "~> 15"
gem "chef", ">= 17.0"
gem "knife"
else
gem "chef", ">= 16.0"
gem "chef-zero", "~> 15"
gem "chef", "~> 18"
gem "knife"
end
gem "rspec-expectations"
gem "rspec-mocks"
gem "rspec-mocks", "3.9.0"
gem "rspec_junit_formatter"
gem "fog-core"
gem "chefstyle", "2.1.1"
gem "chefstyle", "2.2.2"
end
4 changes: 2 additions & 2 deletions knife-cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Gem::Specification.new do |s|
s.files = %w{LICENSE} + Dir.glob("lib/**/*")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = %w{lib}
s.required_ruby_version = ">= 2.6"
s.required_ruby_version = ">= 3.1"

s.add_dependency "chef", ">= 15.11"
s.add_dependency "chef", ">= 18.0"
s.add_dependency "mixlib-shellout"
s.add_dependency "excon", ">= 0.50" # excon 0.50 renamed the errors class and required updating rescues
end
18 changes: 9 additions & 9 deletions lib/chef/knife/cloud/fog/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ def delete_server(server_name)

%w{servers images networks}.each do |resource_type|
define_method("list_#{resource_type}") do
begin
case resource_type
when "networks"
network.method(resource_type).call.all
else
connection.method(resource_type).call.all
end
rescue Excon::Error::BadRequest => e
handle_excon_exception(CloudExceptions::CloudAPIException, e)

case resource_type
when "networks"
network.method(resource_type).call.all
else
connection.method(resource_type).call.all
end
rescue Excon::Error::BadRequest => e
handle_excon_exception(CloudExceptions::CloudAPIException, e)

end
end

Expand Down