Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/tiller
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module Tiller

# Is there a common.yaml ? If so, load that first
common_file = File.join(config[:tiller_base], 'common.yaml')
if File.exists?(common_file)
if File.exist?(common_file)
config.merge!(YAML.load(open(common_file)))
config_loaded = true
end
Expand Down Expand Up @@ -242,7 +242,7 @@ module Tiller
filename = target_values['target']

# MD5 checksum of templates
if config['md5sum'] && File.exists?(filename)
if config['md5sum'] && File.exist?(filename)
template_md5 = Digest::MD5.hexdigest(parsed_template)
log.debug("MD5 of #{template} is #{template_md5}")
file_md5 = Digest::MD5.hexdigest(File.read(filename))
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 1.x
* 1.5.1 (07/Nov/2024)
* Updated File/Dir.exists? to exist? due to exists? being removed from Ruby 3.2+
* 1.5.0 (02/Feb/2019)
* Fixed [Issue #48](https://github.com/markround/tiller/issues/48). MD5 checksums were incorrectly calculated as a newline character was getting added. Also modified --no-exec flag so that it also prevents any exec_on_write commands running. Thanks again [EugenMayer](https://github.com/EugenMayer) for the comments.

Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/consul.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


Given(/^an empty consul data directory$/) do
if Dir.exists?(CONSUL_DATA_DIR)
if Dir.exist?(CONSUL_DATA_DIR)
puts "Directory #{CONSUL_DATA_DIR} exists, deleting"
FileUtils.rm_r(CONSUL_DATA_DIR)
else
Expand All @@ -42,4 +42,4 @@
Then (/^the consul key "(.+)" should exist$/) do |key|
test = Diplomat::Kv.get(key)
expect(test.size).to be > 0
end
end
4 changes: 2 additions & 2 deletions features/step_definitions/vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Vault configuration
VAULT_TOKEN_FILE = "#{Dir.home}/.vault-token"
# So that Cucumber does not complain that the file does not exist
File.open(VAULT_TOKEN_FILE, "w+"){|file| file.write(".")} if !File.exists? VAULT_TOKEN_FILE
File.open(VAULT_TOKEN_FILE, "w+"){|file| file.write(".")} if !File.exist? VAULT_TOKEN_FILE

Vault.configure do |config|
config.address = "http://127.0.0.1:8200"
Expand All @@ -26,7 +26,7 @@
end

And (/^a token should be created$/) do
test = File.exists? VAULT_TOKEN_FILE
test = File.exist? VAULT_TOKEN_FILE
expect(test).to be_truthy
end

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/zip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
zip_file.each do |entry|
dest = File.join(dirname, entry.name)
puts "Extracting #{entry.name} to #{dest}"
if File.exists?(dest)
if File.exist?(dest)
puts "File exists, skipping..."
else
entry.extract(dest)
Expand Down
2 changes: 1 addition & 1 deletion lib/tiller/vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setup

# Sanity checks
['url'].each {|c| raise "Missing Vault configuration #{c}" unless @vault_config.has_key?(c)}
raise "Missing Vault token" if !((VAULT_TOKEN_FILE && File.exists?(VAULT_TOKEN_FILE)) || @vault_config['token'] || ENV['VAULT_TOKEN'])
raise "Missing Vault token" if !((VAULT_TOKEN_FILE && File.exist?(VAULT_TOKEN_FILE)) || @vault_config['token'] || ENV['VAULT_TOKEN'])

Vault.configure do |config|
# The address of the Vault server
Expand Down