Cleanup of slapgrid

parent 08cf13d7
...@@ -12,15 +12,8 @@ ...@@ -12,15 +12,8 @@
# #
############################################################################## ##############################################################################
import hashlib
import os
import posixpath
import re
import shutil import shutil
import urlparse
import traceback import traceback
import utils
import json import json
import platform import platform
......
...@@ -48,7 +48,6 @@ from utils import setRunning ...@@ -48,7 +48,6 @@ from utils import setRunning
from utils import setFinished from utils import setFinished
from utils import getSoftwareUrlHash from utils import getSoftwareUrlHash
from slapos import slap from slapos import slap
from slapos.slap import NotFoundError
from slapos.slap.slap import ServerError from slapos.slap.slap import ServerError
from utils import dropPrivileges from utils import dropPrivileges
from utils import SlapPopen from utils import SlapPopen
...@@ -57,7 +56,6 @@ import tempfile ...@@ -57,7 +56,6 @@ import tempfile
from time import strftime from time import strftime
import StringIO import StringIO
from lxml import etree from lxml import etree
from time import sleep
from random import random from random import random
from slapos.slap.slap import NotFoundError from slapos.slap.slap import NotFoundError
...@@ -721,12 +719,13 @@ class Slapgrid(object): ...@@ -721,12 +719,13 @@ class Slapgrid(object):
usage_string = StringIO.StringIO(computer_partition_usage.usage) usage_string = StringIO.StringIO(computer_partition_usage.usage)
root = etree.parse(usage_string) root = etree.parse(usage_string)
except UnicodeError: except UnicodeError:
logger.info("Failed to read %s." % (computer_partition_usage.usage)) self.logger.info("Failed to read %s." % (
logger.error(UnicodeError) computer_partition_usage.usage))
self.logger.error(UnicodeError)
raise "Failed to read %s." % (computer_partition_usage.usage) raise "Failed to read %s." % (computer_partition_usage.usage)
except (etree.XMLSyntaxError, etree.DocumentInvalid) as e: except (etree.XMLSyntaxError, etree.DocumentInvalid) as e:
logger.info("Failed to parse %s." % (usage_string)) self.logger.info("Failed to parse %s." % (usage_string))
logger.error(e) self.logger.error(e)
raise _formatXMLError(e) raise _formatXMLError(e)
except Exception: except Exception:
raise "Failed to generate XML report." raise "Failed to generate XML report."
......
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