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
Guillaume Hervier
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):
...
@@ -173,11 +173,17 @@ class Software(object):
finally
:
finally
:
shutil
.
rmtree
(
extends_cache
)
shutil
.
rmtree
(
extends_cache
)
def
remove
(
self
):
def
destroy
(
self
):
"""Removes the part that was installed.
"""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
:
try
:
shutil
.
rmtree
(
self
.
software_path
)
shutil
.
rmtree
(
self
.
software_path
,
onerror
=
retry
)
except
IOError
as
error
:
except
IOError
as
error
:
error_string
=
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
error_string
=
"I/O error while removing software (%s): %s"
%
(
self
.
url
,
error
)
error
)
...
...
slapos/grid/slapgrid.py
View file @
c1f37926
...
@@ -427,10 +427,11 @@ class Slapgrid(object):
...
@@ -427,10 +427,11 @@ class Slapgrid(object):
logger
.
info
(
"Processing software releases..."
)
logger
.
info
(
"Processing software releases..."
)
clean_run
=
True
clean_run
=
True
for
software_release
in
self
.
computer
.
getSoftwareReleaseList
():
for
software_release
in
self
.
computer
.
getSoftwareReleaseList
():
state
=
software_release
.
getState
()
try
:
try
:
software_release
.
building
()
software_release_uri
=
software_release
.
getURI
()
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
,
console
=
self
.
console
,
buildout
=
self
.
buildout
,
signature_private_key_file
=
self
.
signature_private_key_file
,
signature_private_key_file
=
self
.
signature_private_key_file
,
signature_certificate_list
=
self
.
signature_certificate_list
,
signature_certificate_list
=
self
.
signature_certificate_list
,
...
@@ -443,7 +444,12 @@ class Slapgrid(object):
...
@@ -443,7 +444,12 @@ class Slapgrid(object):
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_cert_file
=
self
.
shadir_cert_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
):
except
(
SystemExit
,
KeyboardInterrupt
):
exception
=
traceback
.
format_exc
()
exception
=
traceback
.
format_exc
()
software_release
.
error
(
exception
)
software_release
.
error
(
exception
)
...
@@ -454,7 +460,10 @@ class Slapgrid(object):
...
@@ -454,7 +460,10 @@ class Slapgrid(object):
software_release
.
error
(
exception
)
software_release
.
error
(
exception
)
clean_run
=
False
clean_run
=
False
else
:
else
:
software_release
.
available
()
if
state
==
'available'
:
software_release
.
available
()
elif
state
==
'destroyed'
:
software_release
.
destroyed
()
logger
.
info
(
"Finished software releases..."
)
logger
.
info
(
"Finished software releases..."
)
return
clean_run
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