Commit 57237fc5 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge remote-tracking branch 'origin/arnau'

parents 8ca213fc 190cdcc6
......@@ -38,16 +38,18 @@ setup(name=name,
'lxml', # needed to play with XML trees
'netaddr>=0.7.5', # to play safely with IPv6 prefixes
'netifaces', # to fetch information about network devices
'pyflakes', # For testing purposes
'setuptools', # namespaces
'supervisor', # slapgrid uses supervisor to manage processes
'unittest2',
'xml_marshaller>=0.9.3', # to unmarshall/marshall python objects to/from
# XML
'zope.interface', # slap library implementes interfaces
'zc.buildout',
] + additional_install_requires,
extra_requires={'docs': ('Sphinx', 'repoze.sphinx.autointerface'),},
tests_require=[
'unittest2',
'pyflakes',
],
zip_safe=False, # proxy depends on Flask, which has issues with
# accessing templates
entry_points={
......
......@@ -1026,17 +1026,17 @@ class Slapgrid(object):
for computer_partition_usage in computer_partition_usage_list:
try:
root = etree.fromstring(computer_partition_usage.usage)
except UnicodeError:
except UnicodeError, e:
self.logger.info("Failed to read %s." % (
computer_partition_usage.usage))
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:
self.logger.info("Failed to parse %s." % (computer_partition_usage.usage))
self.logger.error(e)
raise _formatXMLError(e)
except Exception:
raise "Failed to generate XML report."
except Exception, e:
raise Exception("Failed to generate XML report: %s" % e)
for movement in root.findall('movement'):
xml.append('<movement>')
......@@ -1220,7 +1220,7 @@ class Slapgrid(object):
slap_computer_usage.reportUsage(computer_consumption)
else:
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:
computer_partition_id = computer_partition.getId()
exception = traceback.format_exc()
......
#!/opt/slapos/bin/py
# -*- coding: utf-8 -*-
# vim: set et sts=4:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment