From cf99e1e3c448000cba5e4034d1d96a7219eb3a28 Mon Sep 17 00:00:00 2001 From: Benedikt Trefzer Date: Sat, 7 Dec 2024 16:57:06 +0100 Subject: [PATCH] use undef instead of '' for borgbackup::ssh_key_define --- manifests/init.pp | 6 +++--- spec/classes/borgbackup_spec.rb | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 9cfbfb8..99bea63 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,7 +8,7 @@ # if we true (default) we create the .ssh directory # @param ssh_key_define # the resource to use for the generation of an ssh key -# defaults to '' +# defaults to undef # @param ssh_key_res # the parameters to use for the $ssh_key_define # defaults to {} @@ -35,7 +35,7 @@ class borgbackup ( String $configdir = '/etc/borgbackup', Boolean $ensure_ssh_directory = true, - String $ssh_key_define = '', + Optional[String[1]] $ssh_key_define = undef, Hash $ssh_key_res = {}, Hash $repos = { $facts['networking']['fqdn'] => {} }, Optional[String[1]] $default_target = undef, @@ -61,7 +61,7 @@ } } - if $ssh_key_define != '' { + if $ssh_key_define { create_resources($ssh_key_define, $ssh_key_res) } diff --git a/spec/classes/borgbackup_spec.rb b/spec/classes/borgbackup_spec.rb index 53c49a5..f6d9656 100644 --- a/spec/classes/borgbackup_spec.rb +++ b/spec/classes/borgbackup_spec.rb @@ -5,7 +5,6 @@ let :default_params do { configdir: '/etc/borgbackup', ensure_ssh_directory: true, - ssh_key_define: '', ssh_key_res: {}, repos_defaults: {} } end