old_contents: 
  import paasmaker
  from ..base import BaseJob
  from paasmaker.util.plugin import MODE
  
  import colander
  
  class SourceSCMJobParametersSchema(colander.MappingSchema):
  	scm_name = colander.SchemaNode(colander.String())
  	scm_parameters = colander.SchemaNode(colander.Mapping(unknown='preserve'))
  
  class SourceSCMJob(BaseJob):
  	"""
  	A job to fetch source code from an SCM, so it can be read and prepared.
  	"""
  	MODES = {
  		MODE.JOB: SourceSCMJobParametersSchema()
  	}
  
  	def start_job(self, context):
  		try:
  			self.scm_plugin = self.configuration.plugins.instantiate(
  				self.parameters['scm_name'],
  				paasmaker.util.plugin.MODE.SCM_EXPORT,
  				self.parameters['scm_parameters'],
  				self.logger
  			)
  		except paasmaker.common.configuration.InvalidConfigurationException, ex:
  			error_message = "Failed to start a SCM plugin for %s.", self.parameters['scm_name']
  			logger.critical(error_message)
  			logger.critical(ex)
  			self.failed(error_message)
  			return
  
  		# Now that SCM plugin should create us a directory that we can work on.
  		# The success callback will emit a working directory.
  		# TODO: Cleanup on failure/abort.
  		self.scm_plugin.create_working_copy(self.scm_success, self.scm_failure)
  
  	def scm_success(self, path, message, parameters={}):
  		# Emit the path via the context.
  		self.success({'working_path': path, 'scm_output': parameters}, message)
  
  	def scm_failure(self, message):
  		# Signal failure.
  		# TODO: Cleanup.
  		self.failed(message)
  
  	def abort_job(self):
  		# Ask the plugin to stop.
  		# It should exit with an error of some kind.
  		if hasattr(self, 'scm_plugin'):
  			self.scm_plugin.abort()
  		# Otherwise, do nothing.
  
new_contents: 
  import paasmaker
  from ..base import BaseJob
  from paasmaker.util.plugin import MODE
  
  import colander
  
  class SourceSCMJobParametersSchema(colander.MappingSchema):
  	scm_name = colander.SchemaNode(colander.String())
  	scm_parameters = colander.SchemaNode(colander.Mapping(unknown='preserve'))
  
  class SourceSCMJob(BaseJob):
  	"""
  	A job to fetch source code from an SCM, so it can be read and prepared.
  	"""
  	MODES = {
  		MODE.JOB: SourceSCMJobParametersSchema()
  	}
  
  	def start_job(self, context):
  		try:
  			self.scm_plugin = self.configuration.plugins.instantiate(
  				self.parameters['scm_name'],
  				paasmaker.util.plugin.MODE.SCM_EXPORT,
  				self.parameters['scm_parameters'],
  				self.logger
  			)
  		except paasmaker.util.configurationhelper.InvalidConfigurationFormatException, ex:
  			error_message = "Failed to start a SCM plugin for %s.", self.parameters['scm_name']
  			self.logger.critical(error_message, exc_info=ex)
  			self.failed(error_message)
  			return
  
  		# Now that SCM plugin should create us a directory that we can work on.
  		# The success callback will emit a working directory.
  		# TODO: Cleanup on failure/abort.
  		self.scm_plugin.create_working_copy(self.scm_success, self.scm_failure)
  
  	def scm_success(self, path, message, parameters={}):
  		# Emit the path via the context.
  		self.success({'working_path': path, 'scm_output': parameters}, message)
  
  	def scm_failure(self, message):
  		# Signal failure.
  		# TODO: Cleanup.
  		self.failed(message)
  
  	def abort_job(self):
  		# Ask the plugin to stop.
  		# It should exit with an error of some kind.
  		if hasattr(self, 'scm_plugin'):
  			self.scm_plugin.abort()
  		# Otherwise, do nothing.
  
subject: Fix some errors in the source SCM plugin in the error paths.