From 3c219fa509e592a224732477014623630bfc6342 Mon Sep 17 00:00:00 2001 From: David Swan Date: Thu, 18 Mar 2021 09:47:32 +0000 Subject: [PATCH] (IAC-1497) - Removal of unsupported `translate` dependency --- .fixtures.yml | 1 - manifests/image.pp | 10 +++++----- manifests/init.pp | 32 ++++++++++++++++---------------- manifests/install.pp | 4 ++-- manifests/plugin.pp | 2 +- manifests/run.pp | 8 ++++---- manifests/service.pp | 2 +- manifests/services.pp | 4 ++-- metadata.json | 4 ---- spec/helper/get_values_init.rb | 2 +- 10 files changed, 32 insertions(+), 37 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 6f878027..07423f65 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,7 +2,6 @@ fixtures: forge_modules: stdlib: 'puppetlabs-stdlib' apt: 'puppetlabs-apt' - translate: 'puppetlabs-translate' powershell: 'puppetlabs-powershell' reboot: 'puppetlabs-reboot' repositories: diff --git a/manifests/image.pp b/manifests/image.pp index 15f8d954..b48781e9 100644 --- a/manifests/image.pp +++ b/manifests/image.pp @@ -69,23 +69,23 @@ ) if ($docker_file) and ($docker_tar) { - fail(translate('docker::image must not have both $docker_file and $docker_tar set')) + fail('docker::image must not have both $docker_file and $docker_tar set') } if ($docker_dir) and ($docker_tar) { - fail(translate('docker::image must not have both $docker_dir and $docker_tar set')) + fail('docker::image must not have both $docker_dir and $docker_tar set') } if ($image_digest) and ($docker_file) { - fail(translate('docker::image must not have both $image_digest and $docker_file set')) + fail('docker::image must not have both $image_digest and $docker_file set') } if ($image_digest) and ($docker_dir) { - fail(translate('docker::image must not have both $image_digest and $docker_dir set')) + fail('docker::image must not have both $image_digest and $docker_dir set') } if ($image_digest) and ($docker_tar) { - fail(translate('docker::image must not have both $image_digest and $docker_tar set')) + fail('docker::image must not have both $image_digest and $docker_tar set') } if $force { diff --git a/manifests/init.pp b/manifests/init.pp index 074a186d..0e660083 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -481,32 +481,32 @@ ) inherits docker::params { if $facts['os']['family'] and ! $acknowledge_unsupported_os { assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| { - fail(translate('This module only works on Debian, Red Hat or Windows based systems.')) + fail('This module only works on Debian, Red Hat or Windows based systems.') } } if ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') < 0) { - fail(translate('This module only works on Red Hat based systems version 7 and higher.')) + fail('This module only works on Red Hat based systems version 7 and higher.') } if ($default_gateway) and (!$bridge) { - fail(translate('You must provide the $bridge parameter.')) + fail('You must provide the $bridge parameter.') } if $log_level { assert_type(Pattern[/^(debug|info|warn|error|fatal)$/], $log_level) |$a, $b| { - fail(translate('log_level must be one of debug, info, warn, error or fatal')) + fail('log_level must be one of debug, info, warn, error or fatal') } } if $log_driver { if $facts['os']['family'] == 'windows' { assert_type(Pattern[/^(none|json-file|syslog|gelf|fluentd|splunk|awslogs|etwlogs)$/], $log_driver) |$a, $b| { - fail(translate('log_driver must be one of none, json-file, syslog, gelf, fluentd, splunk, awslogs or etwlogs')) + fail('log_driver must be one of none, json-file, syslog, gelf, fluentd, splunk, awslogs or etwlogs') } } else { assert_type(Pattern[/^(none|json-file|syslog|journald|gelf|fluentd|splunk|awslogs)$/], $log_driver) |$a, $b| { - fail(translate('log_driver must be one of none, json-file, syslog, journald, gelf, fluentd, splunk or awslogs')) + fail('log_driver must be one of none, json-file, syslog, journald, gelf, fluentd, splunk or awslogs') } } } @@ -514,33 +514,33 @@ if $storage_driver { if $facts['os']['family'] == 'windows' { assert_type(Pattern[/^(windowsfilter)$/], $storage_driver) |$a, $b| { - fail(translate('Valid values for storage_driver on windows are windowsfilter')) + fail('Valid values for storage_driver on windows are windowsfilter') } } else { assert_type(Pattern[/^(aufs|devicemapper|btrfs|overlay|overlay2|vfs|zfs)$/], $storage_driver) |$a, $b| { - fail(translate('Valid values for storage_driver are aufs, devicemapper, btrfs, overlay, overlay2, vfs, zfs.')) + fail('Valid values for storage_driver are aufs, devicemapper, btrfs, overlay, overlay2, vfs, zfs.') } } } if ($bridge) and ($facts['os']['family'] == 'windows') { assert_type(Pattern[/^(none|nat|transparent|overlay|l2bridge|l2tunnel)$/], $bridge) |$a, $b| { - fail(translate('bridge must be one of none, nat, transparent, overlay, l2bridge or l2tunnel on Windows.')) + fail('bridge must be one of none, nat, transparent, overlay, l2bridge or l2tunnel on Windows.') } } if $dm_fs { assert_type(Pattern[/^(ext4|xfs)$/], $dm_fs) |$a, $b| { - fail(translate('Only ext4 and xfs are supported currently for dm_fs.')) + fail('Only ext4 and xfs are supported currently for dm_fs.') } } if ($dm_loopdatasize or $dm_loopmetadatasize) and ($dm_datadev or $dm_metadatadev) { - fail(translate('You should provide parameters only for loop lvm or direct lvm, not both.')) + fail('You should provide parameters only for loop lvm or direct lvm, not both.') } if ($dm_datadev or $dm_metadatadev) and $dm_thinpooldev { - fail(translate('You can use the $dm_thinpooldev parameter, or the $dm_datadev and $dm_metadatadev parameter pair, but you cannot use both.')) # lint:ignore:140chars + fail('You can use the $dm_thinpooldev parameter, or the $dm_datadev and $dm_metadatadev parameter pair, but you cannot use both.') # lint:ignore:140chars } if ($dm_datadev or $dm_metadatadev) { @@ -548,16 +548,16 @@ } if ($dm_datadev and !$dm_metadatadev) or (!$dm_datadev and $dm_metadatadev) { - fail(translate('You need to provide both $dm_datadev and $dm_metadatadev parameters for direct lvm.')) + fail('You need to provide both $dm_datadev and $dm_metadatadev parameters for direct lvm.') } if ($dm_basesize or $dm_fs or $dm_mkfsarg or $dm_mountopt or $dm_blocksize or $dm_loopdatasize or $dm_loopmetadatasize or $dm_datadev or $dm_metadatadev) and ($storage_driver != 'devicemapper') { - fail(translate('Values for dm_ variables will be ignored unless storage_driver is set to devicemapper.')) + fail('Values for dm_ variables will be ignored unless storage_driver is set to devicemapper.') } if($tls_enable) { if(! $tcp_bind) { - fail(translate('You need to provide tcp bind parameter for TLS.')) + fail('You need to provide tcp bind parameter for TLS.') } } @@ -586,7 +586,7 @@ $package_key_check_source = true } 'windows': { - fail(translate('This module only work for Docker Enterprise Edition on Windows.')) + fail('This module only work for Docker Enterprise Edition on Windows.') } default: { $package_location = $docker_package_location diff --git a/manifests/install.pp b/manifests/install.pp index d0e849dc..967955da 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -30,7 +30,7 @@ if $facts['os']['family'] and ! $docker::acknowledge_unsupported_os { assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| { - fail(translate('This module only works on Debian, RedHat or Windows.')) + fail('This module only works on Debian, RedHat or Windows.') } } if $docker::version and $docker::ensure != 'absent' { @@ -55,7 +55,7 @@ $pk_provider = 'yum' } 'windows' : { - fail(translate('Custom package source is currently not implemented on windows.')) + fail('Custom package source is currently not implemented on windows.') } default : { $pk_provider = undef diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 3b55bf03..0b5a815d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -54,7 +54,7 @@ $docker_command = "${docker::params::docker_command} plugin" if ($facts['os']['family'] == 'windows') { - fail(translate('Feature not implemented on windows.')) + fail('Feature not implemented on windows.') } if $ensure == 'present' { diff --git a/manifests/run.pp b/manifests/run.pp index 4e3725b2..3c0c67e0 100644 --- a/manifests/run.pp +++ b/manifests/run.pp @@ -269,11 +269,11 @@ } if ($remove_volume_on_start and !$remove_container_on_start) { - fail(translate("In order to remove the volume on start for ${title} you need to also remove the container")) + fail("In order to remove the volume on start for ${title} you need to also remove the container") } if ($remove_volume_on_stop and !$remove_container_on_stop) { - fail(translate("In order to remove the volume on stop for ${title} you need to also remove the container")) + fail("In order to remove the volume on stop for ${title} you need to also remove the container") } if $use_name { @@ -497,10 +497,10 @@ } default: { if $facts['os']['family'] != 'windows' { - fail(translate('Docker needs a Debian or RedHat based system.')) + fail('Docker needs a Debian or RedHat based system.') } elsif $ensure == 'present' { - fail(translate('Restart parameter is required for Windows')) + fail('Restart parameter is required for Windows') } $hasstatus = $::docker::params::service_hasstatus diff --git a/manifests/service.pp b/manifests/service.pp index fc5b9fc3..c03be61c 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -262,7 +262,7 @@ $root_dir_flag = $docker::root_dir_flag, ) { unless $facts['os']['family'] =~ /(Debian|RedHat|windows)/ or $::docker::acknowledge_unsupported_os { - fail(translate('The docker::service class needs a Debian, Redhat or Windows based system.')) + fail('The docker::service class needs a Debian, Redhat or Windows based system.') } $dns_array = any2array($dns) diff --git a/manifests/services.pp b/manifests/services.pp index 26f19d43..6b8f8f39 100644 --- a/manifests/services.pp +++ b/manifests/services.pp @@ -91,11 +91,11 @@ if $ensure == 'absent' { if $update { - fail(translate('When removing a service you can not update it.')) + fail('When removing a service you can not update it.') } if $scale { - fail(translate('When removing a service you can not update it.')) + fail('When removing a service you can not update it.') } } diff --git a/metadata.json b/metadata.json index 1699b9b8..033c0583 100644 --- a/metadata.json +++ b/metadata.json @@ -16,10 +16,6 @@ "name": "puppetlabs/apt", "version_requirement": ">= 4.4.1 < 9.0.0" }, - { - "name": "puppetlabs/translate", - "version_requirement": ">= 0.0.1 < 3.0.0" - }, { "name": "puppetlabs/powershell", "version_requirement": ">= 2.1.4 < 6.0.0" diff --git a/spec/helper/get_values_init.rb b/spec/helper/get_values_init.rb index 42e75a0a..2b6422c9 100644 --- a/spec/helper/get_values_init.rb +++ b/spec/helper/get_values_init.rb @@ -24,7 +24,7 @@ def get_values_init(_params, _facts) package_key_source = _params['docker_ce_key_source'] package_key_check_source = true # when 'windows' - # fail(translate('This module only work for Docker Enterprise Edition on Windows.')) + # fail('This module only work for Docker Enterprise Edition on Windows.') else package_location = _params['docker_package_location'] package_key_source = _params['docker_package_key_source']