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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
c1f37926
Commit
c1f37926
authored
Mar 26, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement software removal.
parent
8588b456
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+10
-4
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+13
-4
No files found.
slapos/grid/SlapObject.py
View file @
c1f37926
...
...
@@ -173,11 +173,17 @@ class Software(object):
finally
:
shutil
.
rmtree
(
extends_cache
)
def
remove
(
self
):
"""Removes the part that was installed.
"""
def
destroy
(
self
):
"""Removes software release."""
def
retry
(
func
,
path
,
exc
):
# inspired on slapos.buildout hard remover
if
func
==
os
.
path
.
islink
:
os
.
unlink
(
path
)
else
:
os
.
chmod
(
path
,
0600
)
func
(
path
)
try
:
shutil
.
rmtree
(
self
.
software_path
)
shutil
.
rmtree
(
self
.
software_path
,
onerror
=
retry
)
except
IOError
as
error
:
error_string
=
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
error
)
...
...
slapos/grid/slapgrid.py
View file @
c1f37926
...
...
@@ -427,10 +427,11 @@ class Slapgrid(object):
logger
.
info
(
"Processing software releases..."
)
clean_run
=
True
for
software_release
in
self
.
computer
.
getSoftwareReleaseList
():
state
=
software_release
.
getState
()
try
:
software_release
.
building
()
software_release_uri
=
software_release
.
getURI
()
Software
(
url
=
software_release_uri
,
software_root
=
self
.
software_root
,
software
=
Software
(
url
=
software_release_uri
,
software_root
=
self
.
software_root
,
console
=
self
.
console
,
buildout
=
self
.
buildout
,
signature_private_key_file
=
self
.
signature_private_key_file
,
signature_certificate_list
=
self
.
signature_certificate_list
,
...
...
@@ -443,7 +444,12 @@ class Slapgrid(object):
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
).
install
()
shadir_key_file
=
self
.
shadir_key_file
)
if
state
==
'available'
:
software_release
.
building
()
software
.
install
()
elif
state
==
'destroyed'
:
software
.
destroy
()
except
(
SystemExit
,
KeyboardInterrupt
):
exception
=
traceback
.
format_exc
()
software_release
.
error
(
exception
)
...
...
@@ -454,7 +460,10 @@ class Slapgrid(object):
software_release
.
error
(
exception
)
clean_run
=
False
else
:
software_release
.
available
()
if
state
==
'available'
:
software_release
.
available
()
elif
state
==
'destroyed'
:
software_release
.
destroyed
()
logger
.
info
(
"Finished software releases..."
)
return
clean_run
...
...
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