Skip to content

Commit 5894da4

Browse files
committed
Use empty check
1 parent fb0d63e commit 5894da4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/cloud_controller/check_stacks.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ def validate_stack(deprecated_stack)
2222
deprecated_stack_in_config = (configured_stacks.find { |stack| stack['name'] == deprecated_stack }).present?
2323
return if deprecated_stack_in_config
2424

25-
deprecated_stack_in_db = false
26-
@db.fetch('SELECT 1 FROM stacks WHERE name LIKE ? ', deprecated_stack) do |_row|
27-
deprecated_stack_in_db = true
28-
end
25+
deprecated_stack_in_db = true if @db.fetch('SELECT 1 FROM stacks WHERE name LIKE ? ', deprecated_stack).empty?
26+
2927
raise "rake task 'stack_check' failed, stack '#{deprecated_stack}' not supported" if deprecated_stack_in_db
3028
end
3129
end

0 commit comments

Comments
 (0)