Commit b3ff6250 authored by Valery Sizov's avatar Valery Sizov

Resolve conflicts in CE->EE MR

parent f5abc9f6
<<<<<<< HEAD
5.1.0
=======
5.1.1 5.1.1
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
...@@ -11,11 +11,7 @@ ...@@ -11,11 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(version: 20170627211700) do ActiveRecord::Schema.define(version: 20170627211700) do
=======
ActiveRecord::Schema.define(version: 20170623080805) do
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
......
...@@ -196,15 +196,10 @@ module Gitlab ...@@ -196,15 +196,10 @@ module Gitlab
# add_key("key-42", "sha-rsa ...") # add_key("key-42", "sha-rsa ...")
# #
def add_key(key_id, key_content) def add_key(key_id, key_content)
<<<<<<< HEAD
return unless self.authorized_keys_enabled? return unless self.authorized_keys_enabled?
Gitlab::Utils.system_silent([gitlab_shell_keys_path,
'add-key', key_id, self.class.strip_key(key_content)])
=======
gitlab_shell_fast_execute([gitlab_shell_keys_path, gitlab_shell_fast_execute([gitlab_shell_keys_path,
'add-key', key_id, self.class.strip_key(key_content)]) 'add-key', key_id, self.class.strip_key(key_content)])
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
end end
# Batch-add keys to authorized_keys # Batch-add keys to authorized_keys
...@@ -224,20 +219,12 @@ module Gitlab ...@@ -224,20 +219,12 @@ module Gitlab
# Ex. # Ex.
# remove_key("key-342", "sha-rsa ...") # remove_key("key-342", "sha-rsa ...")
# #
<<<<<<< HEAD
def remove_key(key_id, key_content = nil) def remove_key(key_id, key_content = nil)
return unless self.authorized_keys_enabled? return unless self.authorized_keys_enabled?
args = [gitlab_shell_keys_path, 'rm-key', key_id] args = [gitlab_shell_keys_path, 'rm-key', key_id]
args << key_content if key_content args << key_content if key_content
Gitlab::Utils.system_silent(args)
=======
def remove_key(key_id, key_content)
args = [gitlab_shell_keys_path, 'rm-key', key_id]
args << key_content if key_content
gitlab_shell_fast_execute(args) gitlab_shell_fast_execute(args)
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
end end
# Remove all ssh keys from gitlab shell # Remove all ssh keys from gitlab shell
...@@ -246,13 +233,9 @@ module Gitlab ...@@ -246,13 +233,9 @@ module Gitlab
# remove_all_keys # remove_all_keys
# #
def remove_all_keys def remove_all_keys
<<<<<<< HEAD
return unless self.authorized_keys_enabled? return unless self.authorized_keys_enabled?
Gitlab::Utils.system_silent([gitlab_shell_keys_path, 'clear'])
=======
gitlab_shell_fast_execute([gitlab_shell_keys_path, 'clear']) gitlab_shell_fast_execute([gitlab_shell_keys_path, 'clear'])
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
end end
# Remove ssh keys from gitlab shell that are not in the DB # Remove ssh keys from gitlab shell that are not in the DB
...@@ -433,14 +416,12 @@ module Gitlab ...@@ -433,14 +416,12 @@ module Gitlab
File.join(gitlab_shell_path, 'bin', 'gitlab-keys') File.join(gitlab_shell_path, 'bin', 'gitlab-keys')
end end
<<<<<<< HEAD
def authorized_keys_enabled? def authorized_keys_enabled?
# Return true if nil to ensure the authorized_keys methods work while # Return true if nil to ensure the authorized_keys methods work while
# fixing the authorized_keys file during migration. # fixing the authorized_keys file during migration.
return true if current_application_settings.authorized_keys_enabled.nil? return true if current_application_settings.authorized_keys_enabled.nil?
current_application_settings.authorized_keys_enabled current_application_settings.authorized_keys_enabled
=======
private private
def gitlab_shell_fast_execute(cmd) def gitlab_shell_fast_execute(cmd)
...@@ -465,7 +446,6 @@ module Gitlab ...@@ -465,7 +446,6 @@ module Gitlab
# Don't pass along the entire parent environment to prevent gitlab-shell # Don't pass along the entire parent environment to prevent gitlab-shell
# from wasting I/O by searching through GEM_PATH # from wasting I/O by searching through GEM_PATH
Bundler.with_original_env { Popen.popen(cmd, nil, vars) } Bundler.with_original_env { Popen.popen(cmd, nil, vars) }
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
end end
end end
end end
...@@ -105,11 +105,10 @@ describe Gitlab::Shell, lib: true do ...@@ -105,11 +105,10 @@ describe Gitlab::Shell, lib: true do
end end
describe '#add_key' do describe '#add_key' do
<<<<<<< HEAD
context 'when authorized_keys_enabled is true' do context 'when authorized_keys_enabled is true' do
it 'removes trailing garbage' do it 'removes trailing garbage' do
allow(gitlab_shell).to receive(:gitlab_shell_keys_path).and_return(:gitlab_shell_keys_path) allow(gitlab_shell).to receive(:gitlab_shell_keys_path).and_return(:gitlab_shell_keys_path)
expect(Gitlab::Utils).to receive(:system_silent).with( expect(gitlab_shell).to receive(:gitlab_shell_fast_execute).with(
[:gitlab_shell_keys_path, 'add-key', 'key-123', 'ssh-rsa foobar'] [:gitlab_shell_keys_path, 'add-key', 'key-123', 'ssh-rsa foobar']
) )
...@@ -169,13 +168,6 @@ describe Gitlab::Shell, lib: true do ...@@ -169,13 +168,6 @@ describe Gitlab::Shell, lib: true do
end end
end end
end end
=======
it 'removes trailing garbage' do
allow(gitlab_shell).to receive(:gitlab_shell_keys_path).and_return(:gitlab_shell_keys_path)
expect(gitlab_shell).to receive(:gitlab_shell_fast_execute).with(
[:gitlab_shell_keys_path, 'add-key', 'key-123', 'ssh-rsa foobar']
)
>>>>>>> b5b4054d5882782892d0a860c7e95db9a22bfdec
context 'when authorized_keys_enabled is nil' do context 'when authorized_keys_enabled is nil' do
before do before do
......
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