(FM-7316) - i18n Process implemented and .pot file generated
authorDavid Swan <david.swan@puppet.com>
Thu, 30 Aug 2018 15:14:08 +0000 (16:14 +0100)
committerDavid Swan <david.swan@puppet.com>
Fri, 31 Aug 2018 15:31:39 +0000 (16:31 +0100)
13 files changed:
lib/puppet/provider/apt_key/apt_key.rb
lib/puppet/type/apt_key.rb
locales/puppetlabs-apt.pot [new file with mode: 0644]
manifests/backports.pp
manifests/conf.pp
manifests/init.pp
manifests/key.pp
manifests/params.pp
manifests/pin.pp
manifests/ppa.pp
manifests/setting.pp
manifests/source.pp
tasks/init.rb

index fc0d206276b017b90d801b7f562a668ae17cbfed..bcb0bb9730a608f95d093cb939665b64b6e80559 100644 (file)
@@ -119,7 +119,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
   def source_to_file(value)
     parsed_value = URI.parse(value)
     if parsed_value.scheme.nil?
-      raise("The file #{value} does not exist") unless File.exist?(value)
+      raise(_('The file %{_value} does not exist') % { _value: value }) unless File.exist?(value)
       # Because the tempfile method has to return a live object to prevent GC
       # of the underlying file from occuring too early, we also have to return
       # a file object here.  The caller can still call the #path method on the
@@ -139,9 +139,9 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
           key = open(parsed_value, http_basic_authentication: user_pass).read
         end
       rescue OpenURI::HTTPError, Net::FTPPermError => e
-        raise("#{e.message} for #{resource[:source]}")
+        raise(_('%{_e} for %{_resource}') % { _e: e.message, _resource: resource[:source] })
       rescue SocketError
-        raise("could not resolve #{resource[:source]}")
+        raise(_('could not resolve %{_resource}') % { _resource: resource[:source] })
       else
         tempfile(key)
       end
@@ -168,7 +168,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
           end
         end
         unless found_match
-          raise("The id in your manifest #{resource[:name]} and the fingerprint from content/source don't match. Check for an error in the id and content/source is legitimate.")
+          raise(_('The id in your manifest %{_resource} and the fingerprint from content/source don\'t match. Check for an error in the id and content/source is legitimate.') % { _name: resource[:name] }) # rubocop:disable Metrics/LineLength
         end
       else
         warning('/usr/bin/gpg cannot be found for verification of the id.')
@@ -199,7 +199,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
       command.push('add', key_file.path)
     # In case we really screwed up, better safe than sorry.
     else
-      raise("an unexpected condition occurred while trying to add the key: #{resource[:id]}")
+      raise(_('an unexpected condition occurred while trying to add the key: %{_resource}') % { _resource: resource[:id] })
     end
     apt_key(command)
     @property_hash[:ensure] = :present
@@ -215,7 +215,7 @@ Puppet::Type.type(:apt_key).provide(:apt_key) do
   end
 
   def read_only(_value)
-    raise('This is a read-only property.')
+    raise(_('This is a read-only property.'))
   end
 
   mk_resource_methods
index d8b224fd674837b02fceb21156f1f78926314fc5..4a9b241bd48fdf5604de1edae942a69f20128531 100644 (file)
@@ -20,10 +20,10 @@ Puppet::Type.newtype(:apt_key) do
 
   validate do
     if self[:content] && self[:source]
-      raise('The properties content and source are mutually exclusive.')
+      raise(_('The properties content and source are mutually exclusive.'))
     end
     if self[:id].length < 40
-      warning('The id should be a full fingerprint (40 characters), see README.')
+      warning(_('The id should be a full fingerprint (40 characters), see README.'))
     end
   end
 
diff --git a/locales/puppetlabs-apt.pot b/locales/puppetlabs-apt.pot
new file mode 100644 (file)
index 0000000..e43d009
--- /dev/null
@@ -0,0 +1,266 @@
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+# #-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018 Puppet, Inc.
+# This file is distributed under the same license as the puppetlabs-apt package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+# #-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  accounts.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 14:54:05 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 14:48+0100\n"
+"PO-Revision-Date: 2018-08-30 14:48+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppet.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-08-30 16:09:57 +0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+"#-#-#-#-#  puppetlabs-apt.pot (puppetlabs-apt 6.0.0-9-g1d5c598)  #-#-#-#-#\n"
+"Project-Id-Version: puppetlabs-apt 6.0.0-9-g1d5c598\n"
+"\n"
+"Report-Msgid-Bugs-To: docs@puppet.com\n"
+"POT-Creation-Date: 2018-08-30 16:09+0100\n"
+"PO-Revision-Date: 2018-08-30 16:09+0100\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"#-#-#-#-#  puppetlabs-apt_metadata.pot (PACKAGE VERSION)  #-#-#-#-#\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To:\n"
+"POT-Creation-Date: 2018-08-30T14:54:45+01:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 2.0.0\n"
+
+#. ./manifests/backports.pp:36
+msgid ""
+"If not on Debian or Ubuntu, you must explicitly pass location, release, "
+"repos, and key"
+msgstr ""
+
+#. ./manifests/backports.pp:50
+msgid "pin must be either a string, number or hash"
+msgstr ""
+
+#. ./manifests/conf.pp:11
+msgid "Need to pass in content parameter"
+msgstr ""
+
+#. ./manifests/init.pp:37 - ./manifests/params.pp:5
+msgid "This module only works on Debian or derivatives like Ubuntu"
+msgstr ""
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os['name']"
+msgstr ""
+
+#. ./manifests/pin.pp:52
+msgid "parameters release, origin, and version are mutually exclusive"
+msgstr ""
+
+#. ./manifests/pin.pp:56
+msgid "parameter version cannot be used in general form"
+msgstr ""
+
+#. ./manifests/pin.pp:59
+msgid "parameters release and origin are mutually exclusive"
+msgstr ""
+
+#. ./manifests/ppa.pp:10 - ./manifests/source.pp:25
+msgid "lsbdistcodename fact not available: release parameter required"
+msgstr ""
+
+#. ./manifests/ppa.pp:14
+msgid "apt::ppa is not currently supported on Debian."
+msgstr ""
+
+#. ./manifests/setting.pp:11
+msgid "apt::setting cannot have both content and source"
+msgstr ""
+
+#. ./manifests/setting.pp:15
+msgid "apt::setting needs either of content or source"
+msgstr ""
+
+#. ./manifests/setting.pp:23
+msgid ""
+"apt::setting resource name/title must start with either 'conf-', 'pref-' or "
+"'list-'"
+msgstr ""
+
+#. ./manifests/setting.pp:29
+msgid "apt::setting priority must be an integer or a zero-padded integer"
+msgstr ""
+
+#. ./manifests/source.pp:33
+msgid "cannot create a source entry without specifying a location"
+msgstr ""
+
+#. ./manifests/source.pp:47
+msgid "key hash must contain at least an id entry"
+msgstr ""
+
+#. ./manifests/source.pp:86
+msgid "Received invalid value for pin parameter"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:122
+msgid "The file %{_value} does not exist"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:218
+msgid "This is a read-only property."
+msgstr ""
+
+#: ../lib/puppet/type/apt_key.rb:23
+msgid "The properties content and source are mutually exclusive."
+msgstr ""
+
+#. metadata.json
+#: .summary
+msgid ""
+"Provides an interface for managing Apt source, key, and definitions with "
+"Puppet"
+msgstr ""
+
+#. ./manifests/params.pp:97
+msgid "Unable to determine value for fact os[\"name\"]"
+msgstr ""
+
+#. ./manifests/key.pp:29
+msgid "key with id %{_id} already ensured as absent"
+msgstr ""
+
+#. ./manifests/key.pp:62
+msgid "key with id %{_id} already ensured as present"
+msgstr ""
+
+#. ./manifests/key.pp:78
+msgid "Invalid 'ensure' value '%{_ensure}' for apt::key"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:142
+msgid "%{_e} for %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:144
+msgid "could not resolve %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:171
+msgid ""
+"The id in your manifest %{_resource} and the fingerprint from content/source "
+"don't match. Check for an error in the id and content/source is legitimate."
+msgstr ""
+
+#: ../lib/puppet/provider/apt_key/apt_key.rb:202
+msgid ""
+"an unexpected condition occurred while trying to add the key: %{_resource}"
+msgstr ""
+
+#: ../lib/puppet/type/apt_key.rb:26
+msgid "The id should be a full fingerprint (40 characters), see README."
+msgstr ""
index 6a7e87c566da151964a95afc6e9ccf531a12705d..8555cb0f7a2c68455fbab71b18ee122f5a14bc67 100644 (file)
@@ -33,7 +33,7 @@ class apt::backports (
     }
   } else {
     unless $location and $release and $repos and $key {
-      fail('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key')
+      fail(translate('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key'))
     }
   }
 
@@ -47,7 +47,7 @@ class apt::backports (
       'release'  => $_release,
     }
   } else {
-    fail('pin must be either a string, number or hash')
+    fail(translate('pin must be either a string, number or hash'))
   }
 
   apt::source { 'backports':
index b791f852190b4f5938774f1a4ae90db348a6ee39..f41501b5d189a64830e7a4c0cbcd1729ca892e87 100644 (file)
@@ -8,7 +8,7 @@ define apt::conf (
 
   unless $ensure == 'absent' {
     unless $content {
-      fail('Need to pass in content parameter')
+      fail(translate('Need to pass in content parameter'))
     }
   }
 
index 8aa8c6bb660367a61b3486eb2ada0f06901bb64f..28c36353646cf57a4f0be314ec2af2d68d45e312 100644 (file)
@@ -34,7 +34,7 @@ class apt (
 ) inherits apt::params {
 
   if $facts['osfamily'] != 'Debian' {
-    fail('This module only works on Debian or derivatives like Ubuntu')
+    fail(translate('This module only works on Debian or derivatives like Ubuntu'))
   }
 
   if $update['frequency'] {
index 1933b3f9110b996e666208132e06188d1dc8c5a6..8b77978ffb8d70863f01fcdc8fb9e41a9c5ee775 100644 (file)
@@ -26,7 +26,7 @@ define apt::key (
   case $ensure {
     present: {
       if defined(Anchor["apt_key ${id} absent"]){
-        fail("key with id ${id} already ensured as absent")
+        fail(translate('key with id %{_id} already ensured as absent'),{'_id' => id})
       }
 
       if !defined(Anchor["apt_key ${id} present"]) {
@@ -59,7 +59,7 @@ define apt::key (
 
     absent: {
       if defined(Anchor["apt_key ${id} present"]){
-        fail("key with id ${id} already ensured as present")
+        fail(translate('key with id %{_id} already ensured as present', {'_id' => id}))
       }
 
       if !defined(Anchor["apt_key ${id} absent"]){
@@ -75,7 +75,7 @@ define apt::key (
     }
 
     default: {
-      fail "Invalid 'ensure' value '${ensure}' for apt::key"
+      fail translate('Invalid \'ensure\' value \'%{_ensure}\' for apt::key', {'_ensure' => ensure})
     }
   }
 }
index 479ac122358b44bc0aff9639d336904b33a65e94..aeaf114dc7fe3ef1d13064e88429caf9b85912ef 100644 (file)
@@ -2,7 +2,7 @@
 class apt::params {
 
   if $::osfamily != 'Debian' {
-    fail('This module only works on Debian or derivatives like Ubuntu')
+    fail(translate('This module only works on Debian or derivatives like Ubuntu'))
   }
 
   $root           = '/etc/apt'
@@ -94,7 +94,7 @@ class apt::params {
       $ppa_package        = 'software-properties-common'
     }
     undef: {
-      fail('Unable to determine value for fact os["name"]')
+      fail(translate('Unable to determine value for fact os[\"name\"]'))
     }
     default: {
       $ppa_options = undef
index 831d75f03b50b6c4b41215ae71dfeae534910fc3..7e661f2172f9be2f25b4f48b5b72cb4a86c2f653 100644 (file)
@@ -49,14 +49,14 @@ define apt::pin(
   if $packages_string != '*' { # specific form
     if ( $pin_release != '' and ( $origin != '' or $version != '' )) or
       ( $version != '' and ( $pin_release != '' or $origin != '' )) {
-      fail('parameters release, origin, and version are mutually exclusive')
+      fail(translate('parameters release, origin, and version are mutually exclusive'))
     }
   } else { # general form
     if $version != '' {
-      fail('parameter version cannot be used in general form')
+      fail(translate('parameter version cannot be used in general form'))
     }
     if ( $pin_release != '' and $origin != '' ) {
-      fail('parameters release and origin are mutually exclusive')
+      fail(translate('parameters release and origin are mutually exclusive'))
     }
   }
 
index 2ed841bc30684ad49de2916b1ec226ec9e3430cb..1559e00503980106c1d5fd0b4376c5111d8aef2a 100644 (file)
@@ -7,11 +7,11 @@ define apt::ppa(
   Boolean $package_manage        = false,
 ) {
   unless $release {
-    fail('lsbdistcodename fact not available: release parameter required')
+    fail(translate('lsbdistcodename fact not available: release parameter required'))
   }
 
   if $facts['lsbdistid'] == 'Debian' {
-    fail('apt::ppa is not currently supported on Debian.')
+    fail(translate('apt::ppa is not currently supported on Debian.'))
   }
 
   if versioncmp($facts['lsbdistrelease'], '14.10') >= 0 {
index a7b11c48b22a4e19339f3157a959abfdb1707f49..dcf082e095609c7b902fb0c6d46e6acafc495e0c 100644 (file)
@@ -8,11 +8,11 @@ define apt::setting (
 ) {
 
   if $content and $source {
-    fail('apt::setting cannot have both content and source')
+    fail(translate('apt::setting cannot have both content and source'))
   }
 
   if !$content and !$source {
-    fail('apt::setting needs either of content or source')
+    fail(translate('apt::setting needs either of content or source'))
   }
 
   $title_array = split($title, '-')
@@ -20,13 +20,13 @@ define apt::setting (
   $base_name = join(delete_at($title_array, 0), '-')
 
   assert_type(Pattern[/\Aconf\z/, /\Apref\z/, /\Alist\z/], $setting_type) |$a, $b| {
-    fail("apt::setting resource name/title must start with either 'conf-', 'pref-' or 'list-'")
+    fail(translate("apt::setting resource name/title must start with either 'conf-', 'pref-' or 'list-'"))
   }
 
   if $priority !~ Integer {
     # need this to allow zero-padded priority.
     assert_type(Pattern[/^\d+$/], $priority) |$a, $b| {
-      fail('apt::setting priority must be an integer or a zero-padded integer')
+      fail(translate('apt::setting priority must be an integer or a zero-padded integer'))
     }
   }
 
index 724f5f36d3417b9f1503e5321a86704f89db11e6..981933d0c21ce4d7b1b8664fa5f47b75d038c79f 100644 (file)
@@ -22,7 +22,7 @@ define apt::source(
     if $facts['lsbdistcodename'] {
       $_release = $facts['lsbdistcodename']
     } else {
-      fail('lsbdistcodename fact not available: release parameter required')
+      fail(translate('lsbdistcodename fact not available: release parameter required'))
     }
   } else {
     $_release = $release
@@ -30,7 +30,7 @@ define apt::source(
 
   if $ensure == 'present' {
     if ! $location {
-      fail('cannot create a source entry without specifying a location')
+      fail(translate('cannot create a source entry without specifying a location'))
     }
     # Newer oses, do not need the package for HTTPS transport.
     $_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ]
@@ -44,7 +44,7 @@ define apt::source(
   if $key {
     if $key =~ Hash {
       unless $key['id'] {
-        fail('key hash must contain at least an id entry')
+        fail(translate('key hash must contain at least an id entry'))
       }
       $_key = merge($::apt::source_key_defaults, $key)
     } else {
@@ -83,7 +83,7 @@ define apt::source(
         'origin'   => $host,
       }
     } else {
-      fail('Received invalid value for pin parameter')
+      fail(translate('Received invalid value for pin parameter'))
     }
     create_resources('apt::pin', { "${name}" => $_pin })
   }
index ebcf72adddee590f91516a756b07aadeccb16857..b4cb0dc7622744be6334972eeb720ae1d89faf08 100755 (executable)
@@ -7,7 +7,7 @@ def apt_get(action)
   cmd = ['apt-get', action]
   cmd << '-y' if action == 'upgrade'
   stdout, stderr, status = Open3.capture3(*cmd)
-  raise Puppet::Error, stderr if status != 0
+  raise Puppet::Error, stderr if status != 0 # rubocop:disable GetText/DecorateFunctionMessage
   { status: stdout.strip }
 end