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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos.core
Commits
32f3933c
Commit
32f3933c
authored
Apr 22, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faster chown in slapos format
parent
cc0cc694
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
slapos/util.py
slapos/util.py
+13
-6
No files found.
slapos/util.py
View file @
32f3933c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
errno
import
errno
import
os
import
os
import
subprocess
def
mkdir_p
(
path
,
mode
=
0o700
):
def
mkdir_p
(
path
,
mode
=
0o700
):
...
@@ -21,6 +22,12 @@ def mkdir_p(path, mode=0o700):
...
@@ -21,6 +22,12 @@ def mkdir_p(path, mode=0o700):
def
chownDirectory
(
path
,
uid
,
gid
):
def
chownDirectory
(
path
,
uid
,
gid
):
chown_cmd
=
'/bin/chown'
if
os
.
path
.
exists
(
chown_cmd
):
subprocess
.
check_call
([
chown_cmd
,
'-R'
,
'%s:%s'
%
(
uid
,
gid
),
path
])
else
:
# slow fallback.. not unix?
print
'chown..'
,
path
os
.
chown
(
path
,
uid
,
gid
)
os
.
chown
(
path
,
uid
,
gid
)
for
root
,
dirs
,
files
in
os
.
walk
(
path
):
for
root
,
dirs
,
files
in
os
.
walk
(
path
):
for
items
in
dirs
,
files
:
for
items
in
dirs
,
files
:
...
...
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