Commit 95190f59 authored by Ian Baum's avatar Ian Baum
Browse files

Merge branch 'geo_remove_global_methods' into 'master'

Take "get_ctl_options" methods out of global namespace

See merge request gitlab-org/omnibus-gitlab!4646
parents 848abe83 a29b042c
......@@ -19,26 +19,26 @@ require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary
#
 
add_command_under_category('promote-to-primary-node', 'gitlab-geo', 'Promote to primary node', 2) do |cmd_name, *args|
Geo::PromoteToPrimaryNode.new(base_path, get_ctl_options).execute
end
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promote-to-primary-node [options]"
 
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promote-to-primary-node [options]"
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
 
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
opts.on('-m', '--skip-preflight-checks', 'Perform promotion without running any preflight checks') do |m|
options[:skip_preflight_checks] = m
end
 
opts.on('-m', '--skip-preflight-checks', 'Perform promotion without running any preflight checks') do |m|
options[:skip_preflight_checks] = m
end
opts.on('-f', '--force', 'Proceed even if preflight checks fail') do |f|
options[:force] = f
end
end.parse!(ARGV.dup)
 
opts.on('-f', '--force', 'Proceed even if preflight checks fail') do |f|
options[:force] = f
end
end.parse!(ARGV.dup)
options
end
 
options
Geo::PromoteToPrimaryNode.new(base_path, get_ctl_options).execute
end
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promotion_preflight_checks"
 
add_command_under_category('promotion-preflight-checks', 'gitlab-geo', 'Run preflight checks for promotion to primary node', 2) do |cmd_name, *args|
Geo::PromotionPreflightChecks.new(base_path, get_ctl_options).execute
end
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promotion-preflight-checks [options]"
 
def get_ctl_options
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitlab-ctl promotion-preflight-checks [options]"
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
end.parse!(ARGV.dup)
 
opts.on('-p', '--[no-]confirm-primary-is-down', 'Do not ask for confirmation that primary is down') do |p|
options[:confirm_primary_is_down] = p
end
end.parse!(ARGV.dup)
options
end
 
options
Geo::PromotionPreflightChecks.new(base_path, get_ctl_options).execute
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment