From e0dfc93f753e49058f60002fad6d47fc92ac7fd7 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 5 Sep 2014 14:49:54 -0400 Subject: [PATCH] Remove dependency on stdlib4 This removes the backwards incompatible change between 3.0.x and 3.1.x. --- lib/puppet/parser/functions/ntp_dirname.rb | 15 +++++++++++++++ manifests/config.pp | 2 +- metadata.json | 6 +++--- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 lib/puppet/parser/functions/ntp_dirname.rb diff --git a/lib/puppet/parser/functions/ntp_dirname.rb b/lib/puppet/parser/functions/ntp_dirname.rb new file mode 100644 index 00000000..06cdb7ce --- /dev/null +++ b/lib/puppet/parser/functions/ntp_dirname.rb @@ -0,0 +1,15 @@ +module Puppet::Parser::Functions + newfunction(:ntp_dirname, :type => :rvalue, :doc => <<-EOS + Returns the dirname of a path. + EOS + ) do |arguments| + + raise(Puppet::ParseError, "ntp_dirname(): Wrong number of arguments " + + "given (#{arguments.size} for 1)") if arguments.size < 1 + + path = arguments[0] + return File.dirname(path) + end +end + +# vim: set ts=2 sw=2 et : diff --git a/manifests/config.pp b/manifests/config.pp index 1c8963dc..7b2e52de 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -2,7 +2,7 @@ class ntp::config inherits ntp { if $keys_enable { - $directory = dirname($keys_file) + $directory = ntp_dirname($keys_file) file { $directory: ensure => directory, owner => 0, diff --git a/metadata.json b/metadata.json index ad913a45..d3549375 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "license": "Apache Version 2.0", "source": "git://github.com/puppetlabs/puppetlabs-ntp", "project_page": "http://github.com/puppetlabs/puppetlabs-ntp", - "issues_url": "https://github.com/puppetlabs/puppetlabs-ntp/issues", + "issues_url": "https://tickets.puppetlabs.com/browse/MODULES", "operatingsystem_support": [ { "operatingsystem": "RedHat", @@ -70,7 +70,7 @@ "requirements": [ { "name": "pe", - "version_requirement": "3.3.x" + "version_requirement": "3.x" }, { "name": "puppet", @@ -81,7 +81,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.0.0" + "version_requirement": ">= 3.2.0 < 5.0.0" } ] }