Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
File Transfer Service
fts-rest
Commits
5ba1b95a
Commit
5ba1b95a
authored
Feb 07, 2017
by
Alejandro Alvarez Ayllon
Browse files
FTS-704
: Fix regression
parent
53205ce4
Pipeline
#78305
failed with stage
in 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/fts3rest/fts3rest/lib/JobBuilder.py
View file @
5ba1b95a
...
...
@@ -485,16 +485,15 @@ class JobBuilder(object):
self
.
_set_job_source_and_destination
(
self
.
files
)
# If reuse is enabled, source and destination SE must be the same
# for all entries
# If reuse is enabled, source and destination SE must be the same for all entries
# Ignore for multiple replica jobs!
if
job_type
==
'Y'
and
(
not
self
.
job
[
'source_se'
]
or
not
self
.
job
[
'dest_se'
]):
raise
HTTPBadRequest
(
'Reuse jobs can only contain transfers for the same source and destination storage'
)
if
job_type
==
'Y'
and
(
self
.
job
[
'source_se'
]
and
self
.
job
[
'dest_se'
]):
self
.
job
[
'job_type'
]
==
'Y'
if
job_type
==
'N'
:
if
job_type
==
'N'
and
not
self
.
is_multiple
:
self
.
job
[
'job_type'
]
=
'N'
if
(
self
.
job
[
'source_se'
]
and
self
.
job
[
'dest_se'
]
and
(
job_type
is
None
)
and
(
len
(
self
.
files
)
>
1
))
:
...
...
src/fts3rest/fts3rest/tests/functional/test_multiple.py
View file @
5ba1b95a
...
...
@@ -188,6 +188,40 @@ class TestMultiple(TestController):
self
.
assertEqual
(
db_job
.
job_type
,
'R'
)
def
test_submit_with_alternatives3
(
self
):
"""
Same as before, but reuse is set explicitly to False, which should be a no-op
(Regression bug)
"""
self
.
setup_gridsite_environment
()
self
.
push_delegation
()
job
=
{
'files'
:
[
{
'sources'
:
[
'http://source.es/file'
,
'http://source.fr/file'
],
'destinations'
:
[
'http://dest.ch/file'
],
'selection_strategy'
:
'orderly'
,
'checksum'
:
'adler32:1234'
,
'filesize'
:
1024
,
'activity'
:
'something something'
,
'metadata'
:
{
'mykey'
:
'myvalue'
},
}
],
'params'
:
{
'reuse'
:
False
}
}
answer
=
self
.
app
.
post
(
url
=
"/jobs"
,
content_type
=
'application/json'
,
params
=
json
.
dumps
(
job
),
status
=
200
)
# Validate job in the database
job_id
=
json
.
loads
(
answer
.
body
)[
'job_id'
]
db_job
=
Session
.
query
(
Job
).
get
(
job_id
)
self
.
assertEqual
(
db_job
.
job_type
,
'R'
)
def
test_submit_multiple_transfers
(
self
):
"""
Submit one job with multiple independent transfers
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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