Skip to content

Commit

Permalink
Merge pull request #4563 from mlassnig/patch-4562-Fix_FTSCompleteStat…
Browse files Browse the repository at this point in the history
…e_capitalisation

Fix FTSCompleteState capitalisation; Fix #4562
  • Loading branch information
bari12 committed Apr 22, 2021
2 parents 39f64c7 + 294ad4e commit 7a6aad2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
28 changes: 19 additions & 9 deletions lib/rucio/common/constants.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Copyright European Organization for Nuclear Research (CERN)
# -*- coding: utf-8 -*-
# Copyright 2013-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Authors:
# - Vincent Garonne, <vincent.garonne@cern.ch>, 2013
# - Cedric Serfon, <cedric.serfon@cern.ch>, 2015-2021
# - Mario Lassnig, <mario.lassnig@cern.ch>, 2018
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# PY3K COMPATIBLE
# Authors:
# - Vincent Garonne <vincent.garonne@cern.ch>, 2013-2015
# - Cedric Serfon <cedric.serfon@cern.ch>, 2015-2021
# - Martin Barisits <martin.barisits@cern.ch>, 2017
# - Mario Lassnig <mario.lassnig@cern.ch>, 2018-2021
# - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2018
# - Sahan Dilshan <32576163+sahandilshan@users.noreply.github.com>, 2021

from collections import namedtuple

Expand Down Expand Up @@ -41,4 +51,4 @@
'CANCELED'])('SUBMITTED', 'READY', 'ACTIVE', 'FAILED', 'FINISHED', 'FINISHEDDIRTY',
'CANCELED')

FTS_COMPLETE_STATE = namedtuple('FTS_COMPLETE_STATE', ['OK', 'ERROR'])('OK', 'ERROR')
FTS_COMPLETE_STATE = namedtuple('FTS_COMPLETE_STATE', ['OK', 'ERROR'])('Ok', 'Error')
4 changes: 2 additions & 2 deletions lib/rucio/daemons/conveyor/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def on_message(self, frame):
'details': {'files': msg['file_metadata']}}

record_counter('daemons.conveyor.receiver.message_rucio')
if str(msg['t_final_transfer_state']) == FTS_COMPLETE_STATE.OK:
if str(msg['t_final_transfer_state']) == FTS_COMPLETE_STATE.OK: # pylint:disable=no-member
response['new_state'] = RequestState.DONE
elif str(msg['t_final_transfer_state']) == FTS_COMPLETE_STATE.ERROR:
elif str(msg['t_final_transfer_state']) == FTS_COMPLETE_STATE.ERROR: # pylint:disable=no-member
response['new_state'] = RequestState.FAILED

try:
Expand Down

0 comments on commit 7a6aad2

Please sign in to comment.