Skip to content

Commit

Permalink
Merge 5b467df into 618523f
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Aug 2, 2020
2 parents 618523f + 5b467df commit 54a6b60
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .github/SECURITY.md
@@ -0,0 +1,3 @@
# Vox Pupuli Security Policy

Our vulnerabilities reporting process is at https://voxpupuli.org/security/
2 changes: 1 addition & 1 deletion .msync.yml
@@ -1 +1 @@
modulesync_config_version: '2.12.0'
modulesync_config_version: '3.0.0'
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -528,6 +528,9 @@ RSpec/RepeatedDescription:
RSpec/NestedGroups:
Enabled: False

RSpec/MultipleExpectations:
Enabled: false

# this is broken on ruby1.9
Layout/IndentHeredoc:
Enabled: False
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,4 +1,5 @@
---
os: linux
dist: bionic
language: ruby
cache: bundler
Expand All @@ -7,7 +8,7 @@ before_install:
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
jobs:
fast_finish: true
include:
- rvm: 2.4.4
Expand Down Expand Up @@ -60,7 +61,7 @@ notifications:
- "chat.freenode.org#voxpupuli-notifications"
deploy:
provider: puppetforge
user: puppet
username: puppet
password:
secure: "iItNJ/PlMvdSiYjtXWJkS69mF/4XUriTRC6axFoiTgX8BzGNWA1U/anENNyzmhRKcH/Nc0erVeau+RX8vyJ0HmIJOCvYfq5Q/SQWex1fDXLe/UYJkAEWwmeIOVSF2nTEUPDvDn/d6bNEdULw5yrNn1dT8eLqIIXl6/nThdpiS917BX6CeYdojr/mISrLsvihuB5DQRdVzH+hK1bXcECihnOfNH9lQ0lZ2v2ohJiLJL0DadDg0YMMeJMlP7CnBZzRs7fhTPdLMjzCvysef9nqBYRlGBRUn+CaQ4VoQZlWB1JchJup4qCGeU9ANkb8gdKYTy1kFkBrEDuqlUUuuTTMhDpQ+2fGF32zgnXCSnVY8AIriFfO9c1ljxL6k6vaHpfnsPcMrxuQXNeOPGYpVjNGi/Hz8OjuZ3IT07c8SmZgmGaNp+ZIKErJQV0eob0NeA/1P7HheRS5aPEiN8vj/ZGuIGa+BhbTp2riJ599urrSqGDcJ0YzNeW2BvBZQoXs953X4N4yROz4xKMNqPz/jhyGM9w5SBJ/uLiIvKTu+bSsJ2VNyrOOu25eYqzH1zKc71fKiWa1ZOTHKVM24chlmoq3tZTSpSn6OxpptKLxAYZG0IUdFSMy66m8nss1AxL2djScAptugsqpfLqziMArAoN9iWXCeGiWz1qLRl+5AlMrmMY="
on:
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Expand Up @@ -11,9 +11,9 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'voxpupuli-test', '>= 1.0.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'voxpupuli-test', '~> 2.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
end

group :development do
Expand Down
2 changes: 1 addition & 1 deletion functions/bool2num_hash_recursive.pp
Expand Up @@ -34,7 +34,7 @@ function yum::bool2num_hash_recursive($arg) {
Hash => yum::bool2num_hash_recursive($value),
default => $value,
}
Hash({ $key => $return_value })
Hash( { $key => $return_value })
}.reduce |$attrs_memo, $kv| {
merge($attrs_memo, $kv)
}
Expand Down
4 changes: 1 addition & 3 deletions manifests/clean.pp
@@ -1,9 +1,7 @@
# A $(yum clean all) Exec to be notified if desired.
class yum::clean {

exec{'yum_clean_all':
exec { 'yum_clean_all':
command => '/usr/bin/yum clean all',
refreshonly => true,
}

}
1 change: 0 additions & 1 deletion manifests/config.pp
Expand Up @@ -25,7 +25,6 @@
Variant[Boolean, Integer, Enum['absent'], String] $ensure,
String $key = $title,
) {

$_ensure = $ensure ? {
Boolean => bool2num($ensure),
default => $ensure,
Expand Down
1 change: 0 additions & 1 deletion manifests/gpgkey.pp
Expand Up @@ -35,7 +35,6 @@
String $group = 'root',
String $mode = '0644'
) {

$_creators = [$content, $source]
$_used_creators = $_creators.filter |$value| { !empty($value) }

Expand Down
1 change: 0 additions & 1 deletion manifests/group.pp
Expand Up @@ -23,7 +23,6 @@
Enum['present', 'installed', 'latest', 'absent', 'purged'] $ensure = 'present',
Optional[Integer] $timeout = undef,
) {

Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => 'LC_ALL=C',
Expand Down
9 changes: 4 additions & 5 deletions manifests/init.pp
Expand Up @@ -96,7 +96,7 @@
class yum (
Boolean $clean_old_kernels = true,
Boolean $keep_kernel_devel = false,
Hash[String, Variant[String, Integer, Boolean, Hash[String, Variant[String, Integer, Boolean]]]] $config_options = { },
Hash[String, Variant[String, Integer, Boolean, Hash[String, Variant[String, Integer, Boolean]]]] $config_options = {},
Optional[Hash[String, Optional[Hash[String, Variant[String, Integer, Boolean]]]]] $repos = {},
Array[String] $managed_repos = [],
Boolean $manage_os_default_repos = false,
Expand All @@ -105,7 +105,6 @@
Hash[String, Hash[String, String]] $gpgkeys = {},
String $utils_package_name = 'yum-utils',
) {

$module_metadata = load_module_metadata($module_name)
$supported_operatingsystems = $module_metadata['operatingsystem_support']
$supported_os_names = $supported_operatingsystems.map |$os| {
Expand Down Expand Up @@ -162,16 +161,16 @@
}

$_normalized_ensure = $_ensure ? {
Boolean => Hash({ ensure => bool2num($_ensure) }), # lint:ignore:unquoted_string_in_selector
default => Hash({ ensure => $_ensure }), # lint:ignore:unquoted_string_in_selector
Boolean => Hash( { 'ensure' => bool2num($_ensure) }),
default => Hash( { ensure => $_ensure }), # lint:ignore:unquoted_string_in_selector
}

$_normalized_attrs = $attrs ? {
Hash => merge($attrs, $_normalized_ensure),
default => $_normalized_ensure,
}

Hash({ $key => $_normalized_attrs })
Hash( { $key => $_normalized_attrs })
}.reduce |$memo, $cfg_opt_hash| {
merge($memo, $cfg_opt_hash)
}
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Expand Up @@ -25,7 +25,6 @@
Enum['present', 'installed', 'absent', 'purged'] $ensure = 'present',
Optional[Integer] $timeout = undef,
) {

Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => 'LC_ALL=C',
Expand Down
1 change: 0 additions & 1 deletion manifests/plugin/versionlock.pp
Expand Up @@ -18,7 +18,6 @@
String $path = '/etc/yum/pluginconf.d/versionlock.list',
Boolean $clean = false,
) {

yum::plugin { 'versionlock':
ensure => $ensure,
}
Expand Down
4 changes: 0 additions & 4 deletions manifests/versionlock.pp
Expand Up @@ -68,15 +68,12 @@
}

if $facts['package_provider'] == 'yum' and $version =~ Undef {

assert_type(Yum::VersionlockString, $name) |$_expected, $actual | {
fail("Package name must be formatted as %{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not \'${actual}\'. See Yum::Versionlock documentation for details.")
}

$_versionlock = "${line_prefix}${name}"

} else {

assert_type(Yum::RpmName, $name) |$_expected, $actual | {
fail("Package name must be formatted as Yum::RpmName, not \'${actual}\'. See Yum::Rpmname documentation for details.")
}
Expand All @@ -89,7 +86,6 @@
'yum' => "${line_prefix}${epoch}:${name}-${version}-${release}.${arch}",
default => "${line_prefix}${name}-${epoch}:${version}-${release}.${arch}",
}

}

unless $ensure == 'absent' {
Expand Down
10 changes: 6 additions & 4 deletions spec/defines/versionlock_spec.rb
Expand Up @@ -99,18 +99,17 @@
end

let(:title) { 'bash' }
let(:params) { { version: '4.3' } }

context 'with version set' do
it { is_expected.to compile.with_all_deps }
let(:params) { { version: '4.3' } }

it 'contains a well-formed Concat::Fragment' do
is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("0:bash-4.3-*.*\n")
end
end

context 'with version, release, epoch and arch set' do
it { is_expected.to compile.with_all_deps }
let(:params) do
{
version: '4.3',
Expand All @@ -120,8 +119,11 @@
}
end

it 'contains a well-formed Concat::Fragment' do
is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("42:bash-4.3-3.2.arm\n")
context 'it works' do
it { is_expected.to compile.with_all_deps }
it 'contains a well-formed Concat::Fragment' do
is_expected.to contain_concat__fragment("yum-versionlock-#{title}").with_content("42:bash-4.3-3.2.arm\n")
end
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper_acceptance.rb
@@ -1,3 +1,6 @@
# This file is completely managed via modulesync
require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker

Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }

0 comments on commit 54a6b60

Please sign in to comment.