Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fts-rest
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
File Transfer Service
fts-rest
Commits
41f3921d
Commit
41f3921d
authored
8 years ago
by
Alejandro Alvarez Ayllon
Browse files
Options
Downloads
Patches
Plain Diff
FTS-822
: Use enum for the states
parent
ff1d62a7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fts3/model/file.py
+5
-4
5 additions, 4 deletions
src/fts3/model/file.py
src/fts3/model/job.py
+4
-4
4 additions, 4 deletions
src/fts3/model/job.py
with
9 additions
and
8 deletions
src/fts3/model/file.py
+
5
−
4
View file @
41f3921d
...
...
@@ -16,15 +16,16 @@
# limitations under the License.
from
sqlalchemy
import
BigInteger
from
sqlalchemy
import
Boolean
,
Column
,
DateTime
,
Float
from
sqlalchemy
import
ForeignKey
,
Integer
,
String
from
sqlalchemy
import
ForeignKey
,
Integer
,
String
,
Enum
from
sqlalchemy.dialects
import
sqlite
from
sqlalchemy.orm
import
relation
,
backref
from
base
import
Base
,
Json
FileActiveStates
=
[
'
SUBMITTED
'
,
'
READY
'
,
'
STARTED
'
,
'
ACTIVE
'
,
'
STAGING
'
]
FileActiveStates
=
[
'
STAGING
'
,
'
STARTED
'
,
'
SUBMITTED
'
,
'
READY
'
,
'
ACTIVE
'
]
FileTerminalStates
=
[
'
FINISHED
'
,
'
FAILED
'
,
'
CANCELED
'
]
# NOT_USED is not terminal, nor not-terminal
FileOnHoldStates
=
[
'
NOT_USED
'
]
# sqlite doesn't like auto increment with BIGINT, so we need to use a variant
# on that case
...
...
@@ -41,7 +42,7 @@ class File(Base):
vo_name
=
Column
(
String
(
50
))
source_se
=
Column
(
String
(
255
))
dest_se
=
Column
(
String
(
255
))
file_state
=
Column
(
String
(
32
))
file_state
=
Column
(
Enum
(
*
(
FileActiveStates
+
FileTerminalStates
+
FileOnHoldStates
)
))
transfer_host
=
Column
(
String
(
255
))
source_surl
=
Column
(
String
(
1100
))
dest_surl
=
Column
(
String
(
1100
))
...
...
This diff is collapsed.
Click to expand it.
src/fts3/model/job.py
+
4
−
4
View file @
41f3921d
...
...
@@ -16,14 +16,14 @@
# limitations under the License.
from
file
import
ArchivedFile
from
sqlalchemy
import
Column
,
DateTime
,
Integer
,
String
,
Text
from
sqlalchemy
import
Column
,
DateTime
,
Integer
,
String
,
Enum
from
sqlalchemy.orm
import
relation
,
backref
from
base
import
Base
,
Flag
,
TernaryFlag
,
Json
JobActiveStates
=
[
'
SUBMITTED
'
,
'
READY
'
,
'
ACTIVE
'
,
'
STAGING
'
,
'
DELETE
'
]
JobTerminalStates
=
[
'
FINISHED
'
,
'
CANCELED
'
,
'
FAILED
'
,
'
FINISHEDDIRTY
'
]
JobActiveStates
=
[
'
STAGING
'
,
'
SUBMITTED
'
,
'
READY
'
,
'
ACTIVE
'
,
'
DELETE
'
]
JobTerminalStates
=
[
'
FINISHED
'
,
'
FAILED
'
,
'
FINISHEDDIRTY
'
,
'
CANCELED
'
]
class
Job
(
Base
):
...
...
@@ -32,7 +32,7 @@ class Job(Base):
job_id
=
Column
(
String
(
36
),
primary_key
=
True
)
source_se
=
Column
(
String
(
255
))
dest_se
=
Column
(
String
(
255
))
job_state
=
Column
(
String
(
32
))
job_state
=
Column
(
Enum
(
*
(
JobActiveStates
+
JobTerminalStates
)
))
job_type
=
Column
(
String
(
1
),
default
=
'
N
'
)
cancel_job
=
Column
(
Flag
(
negative
=
None
))
submit_host
=
Column
(
String
(
255
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment