Skip to content

Commit

Permalink
Simplify with a ternary operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Charreau committed Dec 20, 2023
1 parent b8c48eb commit 0fb187b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/puppet/provider/elastic_stack_keystore/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ def self.elastic_keystore_password_file_bak
end

def self.elastic_keystore_password_bak
if File.file?(elastic_keystore_password_file_bak)
@elastic_keystore_password_bak ||= File.open(elastic_keystore_password_file_bak, &:readline).strip
else
@elastic_keystore_password_bak ||= ''
end
@elastic_keystore_password_bak ||= File.file?(elastic_keystore_password_file_bak) ? File.open(elastic_keystore_password_file_bak, &:readline).strip : ''
end

attr_accessor :defaults_dir, :root_dir, :home_dir_kibana, :home_dir_elasticsearch, :elastic_keystore_password_file, :elastic_keystore_password, :elastic_keystore_password_file_bak, :elastic_keystore_password_bak
Expand Down

0 comments on commit 0fb187b

Please sign in to comment.