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
Léo-Paul Géneau
slapos.core
Commits
102f0ff3
Commit
102f0ff3
authored
Aug 11, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli/prune: fix some typos
parent
053ab26d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
slapos/cli/prune.py
slapos/cli/prune.py
+1
-1
slapos/tests/test_prune.py
slapos/tests/test_prune.py
+11
-11
No files found.
slapos/cli/prune.py
View file @
102f0ff3
...
...
@@ -106,7 +106,7 @@ def _prune(
if
not
dry_run
:
rmtree
(
shared_part
)
logger
.
warning
(
'Unus
u
ed shared parts at %s%s'
,
shared_part
,
'Unused shared parts at %s%s'
,
shared_part
,
''
if
dry_run
else
' ... removed'
)
yield
shared_part
...
...
slapos/tests/test_prune.py
View file @
102f0ff3
...
...
@@ -87,7 +87,7 @@ class TestPrune(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
used
))
self
.
assertFalse
(
os
.
path
.
exists
(
not_used
))
self
.
logger
.
warning
.
assert_called_with
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
' ... removed'
)
'Unused shared parts at %s%s'
,
not_used
,
' ... removed'
)
def
test_dry_run
(
self
):
not_used
=
self
.
_createSharedPart
(
'not_used'
)
...
...
@@ -97,7 +97,7 @@ class TestPrune(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
used
))
self
.
assertTrue
(
os
.
path
.
exists
(
not_used
))
self
.
logger
.
warning
.
assert_called_with
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
''
)
'Unused shared parts at %s%s'
,
not_used
,
''
)
def
test_shared_part_used_in_another_shared_part
(
self
):
not_used
=
self
.
_createSharedPart
(
'not_used'
)
...
...
@@ -109,28 +109,28 @@ class TestPrune(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
directly_used_part
))
self
.
assertFalse
(
os
.
path
.
exists
(
not_used
))
self
.
logger
.
warning
.
assert_called_with
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
' ... removed'
)
'Unused shared parts at %s%s'
,
not_used
,
' ... removed'
)
def
test_shared_part_not_used_recursive_dependencies
(
self
):
used_only_by_orph
e
an_part
=
self
.
_createSharedPart
(
'used_only_by_orph
e
an_part'
)
used_only_by_orphan_part
=
self
.
_createSharedPart
(
'used_only_by_orphan_part'
)
not_used
=
self
.
_createSharedPart
(
'not_used'
,
using
=
used_only_by_orph
e
an_part
)
'not_used'
,
using
=
used_only_by_orphan_part
)
used_directly
=
self
.
_createSharedPart
(
'used_directly'
)
self
.
_createFakeSoftware
(
self
.
id
(),
using
=
used_directly
)
do_prune
(
self
.
logger
,
self
.
config
,
True
)
self
.
assertIn
(
mock
.
call
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
''
),
mock
.
call
(
'Unused shared parts at %s%s'
,
not_used
,
''
),
self
.
logger
.
warning
.
mock_calls
)
self
.
assertIn
(
mock
.
call
(
'Unus
ued shared parts at %s%s'
,
used_only_by_orphe
an_part
,
''
),
'Unus
ed shared parts at %s%s'
,
used_only_by_orph
an_part
,
''
),
self
.
logger
.
warning
.
mock_calls
)
do_prune
(
self
.
logger
,
self
.
config
,
False
)
self
.
assertTrue
(
os
.
path
.
exists
(
used_directly
))
self
.
assertFalse
(
os
.
path
.
exists
(
not_used
))
self
.
assertFalse
(
os
.
path
.
exists
(
used_only_by_orph
e
an_part
))
self
.
assertFalse
(
os
.
path
.
exists
(
used_only_by_orphan_part
))
def
test_shared_part_used_in_buildout_script
(
self
):
not_used
=
self
.
_createSharedPart
(
'not_used'
)
...
...
@@ -148,7 +148,7 @@ class TestPrune(unittest.TestCase):
self
.
assertTrue
(
os
.
path
.
exists
(
used_in_script
))
self
.
assertFalse
(
os
.
path
.
exists
(
not_used
))
self
.
logger
.
warning
.
assert_called_with
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
' ... removed'
)
'Unused shared parts at %s%s'
,
not_used
,
' ... removed'
)
if
six
.
PY3
:
self
.
logger
.
debug
.
assert_any_call
(
'Skipping script %s that could not be decoded'
,
binary_script
)
...
...
@@ -205,7 +205,7 @@ shared_part_list =
self
.
assertFalse
(
os
.
path
.
exists
(
not_used
))
self
.
logger
.
warning
.
assert_called_with
(
'Unus
u
ed shared parts at %s%s'
,
not_used
,
' ... removed'
)
'Unused shared parts at %s%s'
,
not_used
,
' ... removed'
)
def
test_recursive_instance_broken_slapos_cfg
(
self
):
instance
=
os
.
path
.
join
(
self
.
instance_root
,
'slappart0'
)
...
...
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