Skip to content

Commit

Permalink
Merge pull request #504 from voxpupuli/modulesync
Browse files Browse the repository at this point in the history
modulesync 7.0.0
  • Loading branch information
bastelfreak committed Aug 18, 2023
2 parents c684945 + 3296b7a commit 7c9734e
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 16 deletions.
11 changes: 7 additions & 4 deletions .github/CONTRIBUTING.md
Expand Up @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian11-64 bundle exec rake beaker
BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
You can replace the string `debian11` with any common operating system.
The following strings are known to work:

* ubuntu1804
* ubuntu2004
* debian10
* ubuntu2204
* debian11
* centos7
* centos8
* centos9
* almalinux8
* almalinux9
* fedora36

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '6.0.0'
modulesync_config_version: '7.0.0'
2 changes: 2 additions & 0 deletions .rubocop.yml
@@ -1,4 +1,6 @@
---
inherit_from: .rubocop_todo.yml

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

Expand Down
20 changes: 20 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,20 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-08-17 21:26:09 UTC using RuboCop version 1.50.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/NonAtomicFileOperation:
Exclude:
- 'lib/puppet/provider/archive/ruby.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowComments.
Style/RedundantInitialize:
Exclude:
- 'lib/puppet_x/bodeco/util.rb'
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 6.0', :require => false
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 3.0', :require => false
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/archive.rb
Expand Up @@ -208,7 +208,7 @@ def should_to_s(value)
desc 'optional header(s) to pass.'

validate do |val|
raise ArgumentError, "headers must be an array: #{val}" unless val.is_a?(::Array)
raise ArgumentError, "headers must be an array: #{val}" unless val.is_a?(Array)
end
end

Expand Down Expand Up @@ -238,12 +238,12 @@ def should_to_s(value)
desc 'provider download options (affects curl, wget, gs, and only s3 downloads for ruby provider)'

validate do |val|
raise ArgumentError, "download_options should be String or Array: #{val}" unless val.is_a?(::String) || val.is_a?(::Array)
raise ArgumentError, "download_options should be String or Array: #{val}" unless val.is_a?(String) || val.is_a?(Array)
end

munge do |val|
case val
when ::String
when String
[val]
else
val
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/bodeco/archive.rb
Expand Up @@ -79,7 +79,7 @@ def win_7zip
Add-Type -AssemblyName System.IO.Compression.FileSystem -erroraction "silentlycontinue"
$zipFile = [System.IO.Compression.ZipFile]::openread(#{@file_path})
foreach ($zipFileEntry in $zipFile.Entries) {
$pwd = (Get-Item -Path ".\" -Verbose).FullName
$pwd = (Get-Item -Path "." -Verbose).FullName
$outputFile = [io.path]::combine($pwd, $zipFileEntry.FullName)
$dir = ([io.fileinfo]$outputFile).DirectoryName
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet_x/bodeco/util.rb
Expand Up @@ -33,7 +33,7 @@ def self.puppet_download(url, filepath)
status = load_file_with_any_terminus(url)
raise ArgumentError, "Previous error(s) resulted in Puppet being unable to retrieve information from environment #{Puppet['environment']} source(s) #{url}'\nMost probable cause is file not found." unless status

File.open(filepath, 'wb') { |file| file.write(status.content) }
File.binwrite(filepath, status.content)
end

# @private
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/archive_go_md5_spec.rb
Expand Up @@ -17,7 +17,7 @@
context 'when file doesn\'t exist' do
it 'raises error' do
allow(PuppetX::Bodeco::Util).to receive(:content).with(uri, username: 'user', password: 'pass').and_return(example_md5)
expect(subject).to run.with_params('user', 'pass', 'non-existent-file', url).and_raise_error(RuntimeError, "Could not parse md5 from url https://gocd\.lan/path/file\.md5 response: #{example_md5}")
expect(subject).to run.with_params('user', 'pass', 'non-existent-file', url).and_raise_error(RuntimeError, "Could not parse md5 from url https://gocd.lan/path/file.md5 response: #{example_md5}")
end
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Expand Up @@ -19,3 +19,4 @@
end

Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f }
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Expand Up @@ -5,6 +5,6 @@

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker
configure_beaker(modules: :metadata)

Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/archive/curl_spec.rb
Expand Up @@ -58,7 +58,7 @@
it 'populates temp netrc file with credentials' do
allow(provider).to receive(:delete_netrcfile) # Don't delete the file or we won't be able to examine its contents.
provider.download(name)
nettc_content = File.open(tempfile.path).read
nettc_content = File.read(tempfile.path)
expect(nettc_content).to eq("machine home.lan\nlogin foo\npassword bar\n")
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/archive/gs_spec.rb
Expand Up @@ -46,7 +46,7 @@

before do
resource[:checksum_url] = url if url
allow(PuppetX::Bodeco::Util).to receive(:content).\
allow(PuppetX::Bodeco::Util).to receive(:content). \
with(url, any_args).and_return(remote_hash)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/archive/ruby_spec.rb
Expand Up @@ -46,7 +46,7 @@

before do
resource[:checksum_url] = url if url
allow(PuppetX::Bodeco::Util).to receive(:content).\
allow(PuppetX::Bodeco::Util).to receive(:content). \
with(url, any_args).and_return(remote_hash)
end

Expand Down

0 comments on commit 7c9734e

Please sign in to comment.