Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
2925af95
Commit
2925af95
authored
Apr 23, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid.promise fixup: create promise folder for the first time with wrong permissions
parent
4f3ef484
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
slapos/grid/promise/__init__.py
slapos/grid/promise/__init__.py
+10
-2
No files found.
slapos/grid/promise/__init__.py
View file @
2925af95
...
...
@@ -313,6 +313,7 @@ class PromiseLauncher(object):
)
if
not
os
.
path
.
exists
(
self
.
promise_output_dir
):
mkdir_p
(
self
.
promise_output_dir
)
self
.
_updateFolderOwner
()
def
_getErrorPromiseResult
(
self
,
promise_process
,
promise_name
,
promise_path
,
message
,
execution_time
=
0
):
...
...
@@ -370,6 +371,13 @@ class PromiseLauncher(object):
except
Queue
.
Empty
:
return
def
_updateFolderOwner
(
self
,
folder_path
=
None
):
stat_info
=
os
.
stat
(
self
.
partition_folder
)
if
folder_path
is
None
:
folder_path
=
os
.
path
.
join
(
self
.
partition_folder
,
PROMISE_STATE_FOLDER_NAME
)
chownDirectory
(
folder_path
,
stat_info
.
st_uid
,
stat_info
.
st_gid
)
def
_launchPromise
(
self
,
promise_name
,
promise_path
,
argument_dict
,
wrap_process
=
False
):
"""
...
...
@@ -460,6 +468,7 @@ class PromiseLauncher(object):
if
promise_process
.
is_alive
():
self
.
logger
.
info
(
"Killing process %s..."
%
promise_name
)
killProcessTree
(
promise_process
.
pid
,
self
.
logger
)
message
=
'Promise timed out after %s seconds'
%
self
.
promise_timeout
queue_item
=
self
.
_getErrorPromiseResult
(
promise_process
,
...
...
@@ -555,8 +564,7 @@ class PromiseLauncher(object):
if
result_state
and
not
failed_promise_name
:
failed_promise_name
=
promise_name
stat_info
=
os
.
stat
(
self
.
partition_folder
)
chownDirectory
(
self
.
promise_output_dir
,
stat_info
.
st_uid
,
stat_info
.
st_gid
)
self
.
_updateFolderOwner
(
self
.
promise_output_dir
)
if
failed_promise_name
:
raise
PromiseError
(
"Promise %r failed."
%
failed_promise_name
)
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