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
Łukasz Nowak
slapos.core
Commits
472301c3
Commit
472301c3
authored
Jul 09, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exception cleanup + be a little less verbose when reporting error to master
parent
8516df18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
20 deletions
+5
-20
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+0
-3
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+5
-17
No files found.
slapos/grid/SlapObject.py
View file @
472301c3
...
...
@@ -263,8 +263,6 @@ class Partition(object):
""" Creates configuration file from template in software_path, then
installs the software partition with the help of buildout
"""
# XXX: Shall be no op in case if revision had not changed
# It requires implementation of revision on server
self
.
logger
.
info
(
"Installing Computer Partition %s..."
\
%
self
.
computer_partition
.
getId
())
# Checks existence and permissions of Partition directory
...
...
@@ -283,7 +281,6 @@ class Partition(object):
os
.
environ
=
utils
.
getCleanEnvironment
(
pwd
.
getpwuid
(
instance_stat_info
.
st_uid
).
pw_dir
)
# Generates buildout part from template
# TODO how to fetch the good template? Naming conventions?
template_location
=
os
.
path
.
join
(
self
.
software_path
,
'template.cfg'
)
config_location
=
os
.
path
.
join
(
self
.
instance_path
,
'buildout.cfg'
)
self
.
logger
.
debug
(
"Copying %r to %r"
%
(
template_location
,
config_location
))
...
...
slapos/grid/slapgrid.py
View file @
472301c3
...
...
@@ -627,26 +627,15 @@ class Slapgrid(object):
local_partition
.
stop
()
computer_partition
.
stopped
()
elif
computer_partition_state
==
"destroyed"
:
# Stop, but safely
local_partition
.
stop
()
try
:
local_partition
.
stop
()
try
:
computer_partition
.
stopped
()
except
(
SystemExit
,
KeyboardInterrupt
):
exception
=
traceback
.
format_exc
()
computer_partition
.
error
(
exception
)
raise
except
Exception
:
pass
computer_partition
.
stopped
()
except
(
SystemExit
,
KeyboardInterrupt
):
exception
=
traceback
.
format_exc
()
computer_partition
.
error
(
exception
)
raise
except
Exception
:
clean_run
=
False
exception
=
traceback
.
format_exc
()
logger
.
error
(
exception
)
computer_partition
.
error
(
exception
)
pass
else
:
error_string
=
"Computer Partition %r has unsupported state: %s"
%
\
(
computer_partition_id
,
computer_partition_state
)
...
...
@@ -656,10 +645,9 @@ class Slapgrid(object):
exception
=
traceback
.
format_exc
()
computer_partition
.
error
(
exception
)
raise
except
Exception
:
except
Exception
as
exception
:
clean_run
=
False
exception
=
traceback
.
format_exc
()
logger
.
error
(
exception
)
logger
.
error
(
traceback
.
format_exc
())
try
:
computer_partition
.
error
(
exception
)
except
(
SystemExit
,
KeyboardInterrupt
):
...
...
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