summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorJason Colyer <jcolyer2007@gmail.com>2019-01-15 11:51:41 -0600
committerJason Colyer <jcolyer2007@gmail.com>2019-01-17 10:07:29 -0600
commitf88b464bf3bfa13dea33489d8f57e5380dbc00cd (patch)
tree8862ac85551609e6917355589bdc936897a45d83 /lib/backup
parent99b6f37fa525b1a19cccfe743d4f56d104c02c78 (diff)
downloadgitlab-ce-f88b464bf3bfa13dea33489d8f57e5380dbc00cd.tar.gz
Modify file restore to rectify tar issue
Adjusted run_pipeline! function to match rubocop syntax requirements Adjusted run_pipeline! function to use variable instead of string interpolation
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/files.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb
index 48cb01b5b82..550c932b2b5 100644
--- a/lib/backup/files.rb
+++ b/lib/backup/files.rb
@@ -75,12 +75,10 @@ module Backup
options[:err] = err_w
status = Open3.pieline(*cmd_list, options)
err_w.close
- unless status.compact.all?(&:success?)
- error = err_r.read
- unless error =~ /^g?tar: \.: Cannot mkdir: No such file or directory$/
- raise Backup::Error, 'Backup failed'
- end
- end
+ return if status.compact.all?(&:success?)
+
+ regex = /^g?tar: \.: Cannot mkdir: No such file or directory$/
+ raise Backup::Error, 'Backup failed' unless err_r.read =~ regex
end
end
end