Exception cleanup + be a little less verbose when reporting error to master

parent 8516df18
......@@ -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))
......
......@@ -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):
......
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