Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e6223bae
Commit
e6223bae
authored
Mar 19, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix undefined method `log_transfer_error'
parent
51aff7ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
ee/changelogs/unreleased/5335-undefined-method-log_transfer_error-for-gitlab-geo-jobartifacttransfer-0x00007fea0ac401e8.yml
...for-gitlab-geo-jobartifacttransfer-0x00007fea0ac401e8.yml
+5
-0
ee/lib/gitlab/geo/transfer.rb
ee/lib/gitlab/geo/transfer.rb
+1
-6
ee/spec/lib/gitlab/geo/transfer_spec.rb
ee/spec/lib/gitlab/geo/transfer_spec.rb
+13
-1
No files found.
ee/changelogs/unreleased/5335-undefined-method-log_transfer_error-for-gitlab-geo-jobartifacttransfer-0x00007fea0ac401e8.yml
0 → 100644
View file @
e6223bae
---
title
:
Resolve "undefined method 'log_transfer_error'"
merge_request
:
author
:
type
:
fixed
ee/lib/gitlab/geo/transfer.rb
View file @
e6223bae
...
...
@@ -39,15 +39,10 @@ module Gitlab
return
true
if
File
.
directory?
(
dir
)
if
File
.
exist?
(
dir
)
log_transfer_error
(
"
#{
dir
}
is not a directory, unable to save
#{
filename
}
"
)
return
false
end
begin
FileUtils
.
mkdir_p
(
dir
)
rescue
=>
e
log_
transfer_
error
(
"unable to create directory
#{
dir
}
:
#{
e
}
"
)
log_error
(
"unable to create directory
#{
dir
}
:
#{
e
}
"
)
return
false
end
...
...
ee/spec/lib/gitlab/geo/transfer_spec.rb
View file @
e6223bae
...
...
@@ -6,6 +6,7 @@ describe Gitlab::Geo::Transfer do
set
(
:primary_node
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary_node
)
{
create
(
:geo_node
)
}
set
(
:lfs_object
)
{
create
(
:lfs_object
,
:with_file
)
}
let
(
:lfs_object_file_path
)
{
lfs_object
.
file
.
path
}
let
(
:url
)
{
primary_node
.
geo_transfers_url
(
:lfs
,
lfs_object
.
id
.
to_s
)
}
let
(
:content
)
{
SecureRandom
.
random_bytes
(
10
)
}
let
(
:size
)
{
File
.
stat
(
lfs_object
.
file
.
path
).
size
}
...
...
@@ -13,7 +14,7 @@ describe Gitlab::Geo::Transfer do
subject
do
described_class
.
new
(
:lfs
,
lfs_object
.
id
,
lfs_object
.
file
.
path
,
lfs_object
_file_
path
,
{
sha256:
lfs_object
.
oid
})
end
...
...
@@ -53,5 +54,16 @@ describe Gitlab::Geo::Transfer do
expect
(
subject
.
download_from_primary
).
to
eq
(
nil
)
end
context
"invalid path"
do
let
(
:lfs_object_file_path
)
{
'/foo/bar'
}
it
'logs an error if the destination directory could not be created'
do
allow
(
FileUtils
).
to
receive
(
:mkdir_p
)
{
raise
Errno
::
EEXIST
}
expect
(
subject
).
to
receive
(
:log_error
).
with
(
"unable to create directory /foo: File exists"
)
expect
(
subject
.
download_from_primary
).
to
be_nil
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment