summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Hassan <ahmad.hassan612@gmail.com>2018-05-24 16:34:26 +0200
committerAhmad Hassan <ahmad.hassan612@gmail.com>2018-05-24 16:34:26 +0200
commita243753330fd407ff95a488ea49cd144e83528e1 (patch)
tree0278a39d68454a5801a966c63542a2eb7a16ffff
parentef8f054b2193e14e5cf1b58f4d36165964a85ee5 (diff)
downloadgitlab-ce-restore-registry-cng.tar.gz
Fix style offensesrestore-registry-cng
-rw-r--r--lib/backup/registry.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/backup/registry.rb b/lib/backup/registry.rb
index 2969b4ac18d..696763bd45a 100644
--- a/lib/backup/registry.rb
+++ b/lib/backup/registry.rb
@@ -4,7 +4,7 @@ module Backup
class Registry < Files
attr_reader :object_storage
- def initialize(object_storage=false)
+ def initialize(object_storage = false)
@object_storage = object_storage
super('registry', Settings.registry.path)
end
@@ -18,6 +18,7 @@ module Backup
end
private
+
def failure_abort(error_message)
puts "[Error] #{error_message}".color(:red)
abort 'Restore registry failed'
@@ -33,7 +34,7 @@ module Backup
def backup_existing_registry
backup_file_name = "registry.#{Time.now.to_i}"
- cmd = %W(s3cmd sync s3://registry s3://tmp/#{backup_file_name}/)
+ cmd = %W(s3cmd sync s3://registry s3://tmp/#{backup_file_name}/)
output, status = Gitlab::Popen.popen(cmd)
@@ -41,7 +42,7 @@ module Backup
end
def cleanup_registry
- cmd = %W(s3cmd del --force --recursive s3://registry)
+ cmd = %w(s3cmd del --force --recursive s3://registry)
output, status = Gitlab::Popen.popen(cmd)
failure_abort(output) unless status.zero?
end
@@ -51,7 +52,7 @@ module Backup
extracted_tar_path = File.join(Gitlab.config.backup.path, "tmp")
FileUtils.mkdir_p(extracted_tar_path, mode: 0700)
- failure_abort("#{registry_tar_path} not found") unless File.exists?(registry_tar_path)
+ failure_abort("#{registry_tar_path} not found") unless File.exist?(registry_tar_path)
untar_cmd = %W(tar -xf #{registry_tar_path} -C #{extracted_tar_path})