Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Check if gear does not have haproxy or distribute runs against non-scale... #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions gear/distribute
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ require 'deployment'

def read_gear_registry
gears = []
if File.exists?(File.join(ENV['OPENSHIFT_HOMEDIR'], 'haproxy-1.4', 'conf', 'gear-registry.db'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind fixing the indentation to be consistent with the rest of the file?

Also, instead of calling File.join twice, please extract a variable and use it in both places instead.

Thanks!

File.open(File.join(ENV['OPENSHIFT_HOMEDIR'], 'haproxy-1.4', 'conf', 'gear-registry.db')).each do |line|
# [email protected]:ruby-1.9;eade013180-andy.ose.rhc.redhat.com
if line =~ /([^@]+)@([^:]+):/
uuid, host = $~[1..2]
gears << [uuid, host]
end
end
end
gears
end

Expand Down