Skip to content
Snippets Groups Projects
Commit 8ad4702e authored by Aakriti Gupta's avatar Aakriti Gupta
Browse files

Make promote-to-primary-node naming consistent

parent 6434f077
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,7 +2,7 @@ require 'io/console'
require 'rainbow/ext/string'
 
module Geo
class PromoteToPrimary
class PromoteToPrimaryNode
def initialize(base_path, options)
@base_path = base_path
@options = options
Loading
Loading
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary"
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary_node"
 
#
# Copyright:: Copyright (c) 2017 GitLab Inc.
Loading
Loading
@@ -18,7 +18,7 @@ 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::PromoteToPrimary.new(base_path, get_ctl_options).execute
Geo::PromoteToPrimaryNode.new(base_path, get_ctl_options).execute
end
 
def get_ctl_options
Loading
Loading
Loading
Loading
@@ -4,10 +4,10 @@ $LOAD_PATH << './files/gitlab-ctl-commands-ee/lib'
$LOAD_PATH << './files/gitlab-ctl-commands/lib'
 
require 'fileutils'
require 'geo/promote_to_primary'
require 'geo/promote_to_primary_node'
require 'gitlab_ctl/util'
 
describe Geo::PromoteToPrimary, '#execute' do
describe Geo::PromoteToPrimaryNode, '#execute' do
subject(:command) { described_class.new(nil, { skip_preflight_checks: true }) }
 
let(:temp_directory) { Dir.mktmpdir }
Loading
Loading
Loading
Loading
@@ -7,9 +7,9 @@ describe 'gitlab-ctl promote-to-primary-node' do
before do
allow_any_instance_of(Omnibus::Ctl).to receive(:require).and_call_original
allow_any_instance_of(Omnibus::Ctl).to receive(:require).with(
'/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary'
'/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/promote_to_primary_node'
) do
require_relative('../../files/gitlab-ctl-commands-ee/lib/geo/promote_to_primary')
require_relative('../../files/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node')
end
 
ctl.load_file('files/gitlab-ctl-commands-ee/promote_to_primary_node.rb')
Loading
Loading
@@ -25,7 +25,7 @@ describe 'gitlab-ctl promote-to-primary-node' do
oldargv = ARGV
ARGV = [] # rubocop:disable Style/MutableConstant
 
expect_any_instance_of(Geo::PromoteToPrimary).to receive(:execute)
expect_any_instance_of(Geo::PromoteToPrimaryNode).to receive(:execute)
 
ctl.promote_to_primary_node
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment