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
559dfa4f
Commit
559dfa4f
authored
Apr 25, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exception cleanup: 'as exc'
parent
4bf79b18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+31
-31
No files found.
slapos/grid/slapgrid.py
View file @
559dfa4f
...
...
@@ -528,8 +528,8 @@ class Slapgrid(object):
def
getComputerPartitionList
(
self
):
try
:
return
self
.
computer
.
getComputerPartitionList
()
except
socket
.
error
as
e
rror
:
self
.
logger
.
fatal
(
e
rror
)
except
socket
.
error
as
e
xc
:
self
.
logger
.
fatal
(
e
xc
)
raise
def
processSoftwareReleaseList
(
self
):
...
...
@@ -589,10 +589,10 @@ class Slapgrid(object):
raise
# Buildout failed: send log but don't print it to output (already done)
except
BuildoutFailedError
as
exc
eption
:
except
BuildoutFailedError
as
exc
:
clean_run
=
False
try
:
software_release
.
error
(
exc
eption
)
software_release
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -601,9 +601,9 @@ class Slapgrid(object):
# For everything else: log it, send it, continue.
except
Exception
:
exc
eption
=
traceback
.
format_exc
()
logger
.
error
(
exc
eption
)
software_release
.
error
(
exc
eption
)
exc
=
traceback
.
format_exc
()
logger
.
error
(
exc
)
software_release
.
error
(
exc
)
clean_run
=
False
else
:
if
state
==
'available'
:
...
...
@@ -862,9 +862,9 @@ class Slapgrid(object):
raise
# Buildout failed: send log but don't print it to output (already done)
except
BuildoutFailedError
as
exc
eption
:
except
BuildoutFailedError
as
exc
:
try
:
computer_partition
.
error
(
exc
eption
)
computer_partition
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -872,10 +872,10 @@ class Slapgrid(object):
traceback
.
format_exc
())
# For everything else: log it, send it, continue.
except
Exception
as
exc
eption
:
except
Exception
as
exc
:
logger
.
error
(
traceback
.
format_exc
())
try
:
computer_partition
.
error
(
exc
eption
)
computer_partition
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -916,11 +916,11 @@ class Slapgrid(object):
computer_partition
.
error
(
traceback
.
format_exc
())
raise
except
Slapgrid
.
PromiseError
as
exc
eption
:
except
Slapgrid
.
PromiseError
as
exc
:
clean_run_promise
=
False
try
:
logger
.
error
(
exc
eption
)
computer_partition
.
error
(
exc
eption
)
logger
.
error
(
exc
)
computer_partition
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -928,10 +928,10 @@ class Slapgrid(object):
traceback
.
format_exc
())
# Buildout failed: send log but don't print it to output (already done)
except
BuildoutFailedError
as
exc
eption
:
except
BuildoutFailedError
as
exc
:
clean_run
=
False
try
:
computer_partition
.
error
(
exc
eption
)
computer_partition
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -939,11 +939,11 @@ class Slapgrid(object):
traceback
.
format_exc
())
# For everything else: log it, send it, continue.
except
Exception
as
exc
eption
:
except
Exception
as
exc
:
clean_run
=
False
logger
.
error
(
traceback
.
format_exc
())
try
:
computer_partition
.
error
(
exc
eption
)
computer_partition
.
error
(
exc
)
except
(
SystemExit
,
KeyboardInterrupt
):
raise
except
Exception
:
...
...
@@ -972,10 +972,10 @@ class Slapgrid(object):
try
:
document
=
etree
.
fromstring
(
to_be_validated
)
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
:
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
xc
:
logger
.
info
(
'Failed to parse this XML report : %s
\
n
%s'
%
\
(
to_be_validated
,
_formatXMLError
(
e
)))
logger
.
error
(
_formatXMLError
(
e
))
(
to_be_validated
,
_formatXMLError
(
e
xc
)))
logger
.
error
(
_formatXMLError
(
e
xc
))
return
False
if
xmlschema
.
validate
(
document
):
...
...
@@ -1004,16 +1004,16 @@ class Slapgrid(object):
for
computer_partition_usage
in
computer_partition_usage_list
:
try
:
root
=
etree
.
fromstring
(
computer_partition_usage
.
usage
)
except
UnicodeError
as
e
:
except
UnicodeError
as
e
xc
:
self
.
logger
.
info
(
"Failed to read %s."
%
computer_partition_usage
.
usage
)
self
.
logger
.
error
(
UnicodeError
)
raise
UnicodeError
(
"Failed to read %s: %s"
%
(
computer_partition_usage
.
usage
,
e
))
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
:
raise
UnicodeError
(
"Failed to read %s: %s"
%
(
computer_partition_usage
.
usage
,
e
xc
))
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
xc
:
self
.
logger
.
info
(
"Failed to parse %s."
%
(
computer_partition_usage
.
usage
))
self
.
logger
.
error
(
e
)
raise
_formatXMLError
(
e
)
except
Exception
as
e
:
raise
Exception
(
"Failed to generate XML report: %s"
%
e
)
self
.
logger
.
error
(
e
xc
)
raise
_formatXMLError
(
e
xc
)
except
Exception
as
e
xc
:
raise
Exception
(
"Failed to generate XML report: %s"
%
e
xc
)
for
movement
in
root
.
findall
(
'movement'
):
xml
.
append
(
'<movement>'
)
...
...
@@ -1246,9 +1246,9 @@ class Slapgrid(object):
raise
except
Exception
:
clean_run
=
False
exc
eption
=
traceback
.
format_exc
()
computer_partition
.
error
(
exc
eption
)
logger
.
error
(
exc
eption
)
exc
=
traceback
.
format_exc
()
computer_partition
.
error
(
exc
)
logger
.
error
(
exc
)
try
:
computer_partition
.
destroyed
()
except
NotFoundError
:
...
...
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