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
Lisa Casino
slapos.core
Commits
45c14c54
Commit
45c14c54
authored
Apr 09, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid: fix deleting file instead of directory with shutil
parent
6976b1d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+5
-1
No files found.
slapos/grid/slapgrid.py
View file @
45c14c54
...
@@ -1172,7 +1172,11 @@ stderr_logfile_backups=1
...
@@ -1172,7 +1172,11 @@ stderr_logfile_backups=1
file_list
=
os
.
listdir
(
computer_partition_path
)
file_list
=
os
.
listdir
(
computer_partition_path
)
for
garbage_file
in
[
".slapgrid"
,
".timestamp"
]:
for
garbage_file
in
[
".slapgrid"
,
".timestamp"
]:
if
garbage_file
in
file_list
:
if
garbage_file
in
file_list
:
shutil
.
rmtree
(
"/"
.
join
([
computer_partition_path
,
garbage_file
]))
garbage_path
=
"/"
.
join
([
computer_partition_path
,
garbage_file
])
if
os
.
path
.
isfile
(
garbage_path
):
os
.
unlink
(
garbage_path
)
else
:
shutil
.
rmtree
(
garbage_path
)
if
os
.
listdir
(
computer_partition_path
)
!=
[]:
if
os
.
listdir
(
computer_partition_path
)
!=
[]:
self
.
logger
.
warning
(
"Free partition %s contains file(s) in %s."
%
(
self
.
logger
.
warning
(
"Free partition %s contains file(s) in %s."
%
(
...
...
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