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
6 changes: 3 additions & 3 deletions lib/openstax/aws/secrets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def update(specifications: nil, substitutions: nil, force_update_these: [])
OpenStax::Aws.logger.info("Secrets did not change")
return false
else
OpenStax::Aws.logger.info("Updating the following secrets in the AWS parameter store: #{changed_secrets}")
OpenStax::Aws.logger.info("Updating the following secrets in the AWS parameter store: #{@changed_secrets}")

# Ship 'em
if !dry_run
Expand All @@ -80,7 +80,7 @@ def update(specifications: nil, substitutions: nil, force_update_these: [])
end

def revert
if @changed_secrets.empty?
if !@changed_secrets || @changed_secrets.empty?
OpenStax::Aws.logger.info("Secrets did not change during the last update, so there is nothing to revert")
else
reverted_secrets = @changed_secrets.map do |changed_secret|
Expand Down Expand Up @@ -119,7 +119,7 @@ def self.changed_secrets(existing_secrets_hash, new_secrets_array)
end

# Keep the old value around in case we need to revert it
new_secrets[:old_value] = existing_secret[:value]
new_secret[:old_value] = existing_secret ? existing_secret[:value] : nil

array.push(new_secret)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/openstax/aws/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.from_body(body)
end

def basename
File.basename(absolute_file_path)
File.basename(absolute_file_path) if absolute_file_path
end

def body
Expand Down
Loading