From 877f92030dc229e782bd300320701f44747fd7db Mon Sep 17 00:00:00 2001 From: Stephan Eicher Date: Fri, 16 Aug 2019 13:58:09 +0200 Subject: [PATCH] Fix deprecation warning in service.pp --- manifests/service.pp | 12 +++--------- metadata.json | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/manifests/service.pp b/manifests/service.pp index f188c15..40d47dd 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -68,27 +68,21 @@ $allow_isolate = undef, ) { - if($type!=undef and $forking==true) + if($type != undef and $forking == true) { fail('Incompatible options: type / forking') } - if($type != 'oneshot' and is_array($execstart) and count($execstart) > 1) + if($type != 'oneshot' and $execstart.is_a(Array) and count($execstart) > 1) { fail('Incompatible options: There are multiple execstart values and Type is not "oneshot"') } - if($type != 'oneshot' and is_array($execstop) and count($execstop) > 1) + if($type != 'oneshot' and $execstop.is_a(Array) and count($execstop) > 1) { fail('Incompatible options: There are multiple execstop values and Type is not "oneshot"') } - # if($restart!=undef) - # { - # # Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always. - # validate_re($restart, [ '^no$', '^on-success$', '^on-failure$', '^on-abnormal$', '^on-watchdog$', '^on-abort$', '^always$'], "Not a supported restart type: ${restart} - Takes one of no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, or always") - # } - include ::systemd concat { "/etc/systemd/system/${servicename}.service": diff --git a/metadata.json b/metadata.json index a68fd7a..3202308 100644 --- a/metadata.json +++ b/metadata.json @@ -58,7 +58,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 3.8.0" + "version_requirement": ">= 4.0.0" } ] }