Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
103
Merge Requests
103
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
bd526170
Commit
bd526170
authored
Mar 27, 2013
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
String exceptions are not allowed in Python >= 2.6.
parent
60400e0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+5
-5
No files found.
slapos/grid/slapgrid.py
View file @
bd526170
...
@@ -1026,17 +1026,17 @@ class Slapgrid(object):
...
@@ -1026,17 +1026,17 @@ class Slapgrid(object):
for
computer_partition_usage
in
computer_partition_usage_list
:
for
computer_partition_usage
in
computer_partition_usage_list
:
try
:
try
:
root
=
etree
.
fromstring
(
computer_partition_usage
.
usage
)
root
=
etree
.
fromstring
(
computer_partition_usage
.
usage
)
except
UnicodeError
:
except
UnicodeError
,
e
:
self
.
logger
.
info
(
"Failed to read %s."
%
(
self
.
logger
.
info
(
"Failed to read %s."
%
(
computer_partition_usage
.
usage
))
computer_partition_usage
.
usage
))
self
.
logger
.
error
(
UnicodeError
)
self
.
logger
.
error
(
UnicodeError
)
raise
"Failed to read %s."
%
(
computer_partition_usage
.
usage
)
raise
UnicodeError
(
"Failed to read %s: %s"
%
(
computer_partition_usage
.
usage
,
e
)
)
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
:
except
(
etree
.
XMLSyntaxError
,
etree
.
DocumentInvalid
)
as
e
:
self
.
logger
.
info
(
"Failed to parse %s."
%
(
computer_partition_usage
.
usage
))
self
.
logger
.
info
(
"Failed to parse %s."
%
(
computer_partition_usage
.
usage
))
self
.
logger
.
error
(
e
)
self
.
logger
.
error
(
e
)
raise
_formatXMLError
(
e
)
raise
_formatXMLError
(
e
)
except
Exception
:
except
Exception
,
e
:
raise
"Failed to generate XML report."
raise
Exception
(
"Failed to generate XML report: %s"
%
e
)
for
movement
in
root
.
findall
(
'movement'
):
for
movement
in
root
.
findall
(
'movement'
):
xml
.
append
(
'<movement>'
)
xml
.
append
(
'<movement>'
)
...
@@ -1220,7 +1220,7 @@ class Slapgrid(object):
...
@@ -1220,7 +1220,7 @@ class Slapgrid(object):
slap_computer_usage
.
reportUsage
(
computer_consumption
)
slap_computer_usage
.
reportUsage
(
computer_consumption
)
else
:
else
:
logger
.
info
(
'XML file generated by asXML is not valid !'
)
logger
.
info
(
'XML file generated by asXML is not valid !'
)
raise
'XML file generated by asXML is not valid !'
raise
ValueError
(
'XML file generated by asXML is not valid !'
)
except
Exception
:
except
Exception
:
computer_partition_id
=
computer_partition
.
getId
()
computer_partition_id
=
computer_partition
.
getId
()
exception
=
traceback
.
format_exc
()
exception
=
traceback
.
format_exc
()
...
...
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