From 89b898c7b05668f676c4df696dae0e6fad4b6280 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 5 Jul 2018 23:44:12 +0200 Subject: [PATCH 1/2] test against master branch of stdlib --- .fixtures.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index e6a83fc5..f12df41b 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,8 +1,6 @@ fixtures: repositories: - stdlib: - repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git" - ref: "4.15.0" + stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git" ruby: "https://github.com/puppetlabs/puppetlabs-ruby.git" gcc: "https://github.com/puppetlabs/puppetlabs-gcc.git" pe_gem: "https://github.com/puppetlabs/puppetlabs-pe_gem.git" From 57fb516349a45c4ad0e868cd4c350237f56f2f21 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 5 Jul 2018 23:44:41 +0200 Subject: [PATCH 2/2] wrap is_pe fact in fact() method to fail safely the fact() methods returns the value of a fact if it is present, otherwise undef. This allows us to safely jump into the else block. And that allows us to use this module as a dependency without the need to always mock the is_pe fact. --- manifests/params.pp | 2 +- metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 71e27042..16ffd348 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -44,7 +44,7 @@ # We check for the function right now instead of $::pe_server_version # which does not get populated on agent nodes as some users use r10k # with razor see https://github.com/acidprime/r10k/pull/219 - if $::is_pe == true or $::is_pe == 'true' { + if fact('is_pe') == true or fact('is_pe') == 'true' { # < PE 4 $is_pe_server = true }elsif is_function_available('pe_compiling_server_version') { diff --git a/metadata.json b/metadata.json index 2e5ca315..4f0f040d 100644 --- a/metadata.json +++ b/metadata.json @@ -53,7 +53,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.15.0 < 5.0.0" + "version_requirement": ">= 4.19.0 < 5.0.0" }, { "name": "puppetlabs/ruby",