Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flamenco-worker-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
flamenco-worker-python
Commits
2ce7358c
Commit
2ce7358c
authored
Nov 12, 2018
by
Sybren A. Stüvel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed sanity check for Python 3.5
parent
bc16facc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
flamenco_worker/cli.py
+2
-2
2 additions, 2 deletions
flamenco_worker/cli.py
flamenco_worker/worker.py
+11
-9
11 additions, 9 deletions
flamenco_worker/worker.py
with
13 additions
and
11 deletions
flamenco_worker/cli.py
+
2
−
2
View file @
2ce7358c
...
...
@@ -210,8 +210,8 @@ def parse_pretask_check_config(confparser, log):
"""
from
.
import
worker
check_read
:
typing
.
List
[
pathlib
.
Path
]
=
[]
check_write
:
typing
.
List
[
pathlib
.
Path
]
=
[]
check_read
=
[]
check_write
=
[]
for
name
,
value
in
confparser
.
items
(
section
=
'
pre_task_check
'
):
if
name
.
startswith
(
'
write
'
):
check_write
.
append
(
pathlib
.
Path
(
value
))
...
...
This diff is collapsed.
Click to expand it.
flamenco_worker/worker.py
+
11
−
9
View file @
2ce7358c
...
...
@@ -47,10 +47,10 @@ class WorkerState(enum.Enum):
SHUTTING_DOWN
=
'
shutting-down
'
@attr.s
(
auto_attribs
=
True
)
@attr.s
()
class
PreTaskCheckParams
:
pre_task_check_write
:
typing
.
Tuple
[
pathlib
.
Path
]
=
(
)
pre_task_check_read
:
typing
.
Tuple
[
pathlib
.
Path
]
=
(
)
pre_task_check_write
=
attr
.
ib
(
validator
=
attr
.
validators
.
instance_of
(
tuple
),
factory
=
tuple
)
pre_task_check_read
=
attr
.
ib
(
validator
=
attr
.
validators
.
instance_of
(
tuple
),
factory
=
tuple
)
class
PreTaskCheckFailed
(
PermissionError
):
...
...
@@ -784,13 +784,15 @@ class FlamencoWorker:
raise
PreTaskCheckFailed
(
'
%s does not exist
'
%
read_path
)
from
None
if
read_path
.
is_dir
():
try
:
# Globbing an unreadable/nonexistant directory just
# returns an empty iterator. Globbing something nonexistant
# inside a non-readable directory raises a PermissionError.
glob
=
(
read_path
/
'
anything
'
).
glob
(
'
*
'
)
list
(
itertools
.
islice
(
glob
,
1
))
(
read_path
/
'
anything
'
).
stat
()
except
PermissionError
:
raise
PreTaskCheckFailed
(
'
%s is not readable
'
%
read_path
)
from
None
except
FileNotFoundError
:
# This is expected.
pass
except
:
self
.
_log
.
exception
(
'
Unexpected shit happened
'
)
raise
SystemExit
(
44
)
else
:
try
:
with
read_path
.
open
(
mode
=
'
r
'
)
as
the_file
:
...
...
@@ -811,7 +813,7 @@ class FlamencoWorker:
post_delete
=
False
try
:
if
write_path
.
is_dir
():
testfile
=
tempfile
.
TemporaryFile
(
'
w
'
,
dir
=
write_path
)
testfile
=
tempfile
.
TemporaryFile
(
'
w
'
,
dir
=
str
(
write_path
)
)
else
:
post_delete
=
not
write_path
.
exists
()
testfile
=
write_path
.
open
(
'
a+
'
)
...
...
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