From f3907ffd44596d888be133f2cfb406b307f33e11 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 27 Aug 2015 14:09:10 +0100 Subject: [PATCH] (MAINT) deprecate ntp_dirname function The dirname function is part of stdlib 4.6 which is already depended upon. --- lib/puppet/parser/functions/ntp_dirname.rb | 2 ++ manifests/config.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/puppet/parser/functions/ntp_dirname.rb b/lib/puppet/parser/functions/ntp_dirname.rb index 06cdb7ce..f9b1d347 100644 --- a/lib/puppet/parser/functions/ntp_dirname.rb +++ b/lib/puppet/parser/functions/ntp_dirname.rb @@ -7,6 +7,8 @@ module Puppet::Parser::Functions raise(Puppet::ParseError, "ntp_dirname(): Wrong number of arguments " + "given (#{arguments.size} for 1)") if arguments.size < 1 + warning("ntp_dirname(): this function is deprecated and will be removed at a later time.") + path = arguments[0] return File.dirname(path) end diff --git a/manifests/config.pp b/manifests/config.pp index 34ffcbdd..42b6356d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -2,7 +2,7 @@ class ntp::config inherits ntp { if $ntp::keys_enable { - $directory = ntp_dirname($ntp::keys_file) + $directory = dirname($ntp::keys_file) file { $directory: ensure => directory, owner => 0,