Skip to content

Commit

Permalink
Merge pull request #262 from puppetlabs/inifile
Browse files Browse the repository at this point in the history
(PA-7091) Vendor inifile in beaker-puppet
  • Loading branch information
mhashizume authored Jan 17, 2025
2 parents 6b86276 + 8efb933 commit 482b83b
Show file tree
Hide file tree
Showing 7 changed files with 642 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
- ruby: "3.0"
coverage: "yes"
- ruby: "3.1"
- ruby: "3.2"
- ruby: "3.3"

env:
COVERAGE: ${{ matrix.coverage }}
Expand Down
2 changes: 1 addition & 1 deletion beaker-puppet.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.description = 'For use for the Beaker acceptance testing tool'
s.license = 'Apache-2.0'

s.required_ruby_version = '>= 2.7', '< 3.2'
s.required_ruby_version = '>= 2.7', '< 3.4'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Expand Down
1 change: 1 addition & 0 deletions lib/beaker-puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'in_parallel'
require 'beaker-puppet/version'
require 'beaker-puppet/wrappers'
require 'beaker-puppet/inifile'

require 'beaker-puppet/helpers/rake_helpers'

Expand Down
3 changes: 1 addition & 2 deletions lib/beaker-puppet/helpers/puppet_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'timeout'
require 'inifile'
require 'resolv'

module Beaker
Expand Down Expand Up @@ -293,7 +292,7 @@ def lay_down_new_puppet_conf(host, configuration_options, testdir)
# @!visibility private
def puppet_conf_for(host, conf_opts)
puppetconf = host.exec(Command.new("cat #{puppet_config(host, 'config', section: 'master')}")).stdout
IniFile.new(default: 'main', content: puppetconf).merge(conf_opts)
BeakerPuppet::IniFile.new(default: 'main', content: puppetconf).merge(conf_opts)
end

# Restarts the named puppet service
Expand Down
3 changes: 1 addition & 2 deletions lib/beaker-puppet/helpers/tk_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'hocon'
require 'hocon/config_error'
require 'inifile'

module Beaker
module DSL
Expand Down Expand Up @@ -70,7 +69,7 @@ def read_tk_config_string(string)
end

begin
return IniFile.new(content: string)
return BeakerPuppet::IniFile.new(content: string)
rescue IniFile::Error
nil
end
Expand Down
Loading

0 comments on commit 482b83b

Please sign in to comment.