From: Jacob Helwig Date: Mon, 25 Jun 2018 18:16:23 +0000 (-0700) Subject: Remove Rubocop Lint/AssignmentInCondition violation X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=47e0571aace7e8222eb6f07ffe35419e07b6a491;p=puppet-sshkeys_core.git Remove Rubocop Lint/AssignmentInCondition violation --- diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb index 6b59078..5c4df53 100644 --- a/lib/puppet/type/ssh_authorized_key.rb +++ b/lib/puppet/type/ssh_authorized_key.rb @@ -90,10 +90,10 @@ module Puppet def should return super if defined?(@should) && @should[0] != :absent - return nil unless user = resource[:user] + return nil unless resource[:user] begin - return File.expand_path("~#{user}/.ssh/authorized_keys") + return File.expand_path("~#{resource[:user]}/.ssh/authorized_keys") rescue Puppet.debug 'The required user is not yet present on the system' return nil