Return an error response rather than just logging a message when uploading a directroy or a tarball that contains a tool dependency definition that is missing wither an <actions> tag set or an <actions_group> tag set.

This commit is contained in:
Greg Von Kuster
2013-11-01 11:53:44 -04:00
parent 4d65e8f26e
commit acf580fdb0
@@ -295,9 +295,8 @@ class UploadController( BaseUIController ):
elif os.path.split( uploaded_file_name )[ -1 ] == suc.TOOL_DEPENDENCY_DEFINITION_FILENAME:
# Inspect the contents of the file to see if changeset_revision values are missing and if so, set them appropriately.
altered, root_elem, error_message = commit_util.handle_tool_dependencies_definition( trans, uploaded_file_name )
# Can this be displayed?
if error_message:
log.debug( str( error_message ) )
return False, error_message, [], '', [], []
if altered:
tmp_filename = xml_util.create_and_write_tmp_file( root_elem )
shutil.move( tmp_filename, uploaded_file_name )
@@ -360,8 +359,7 @@ class UploadController( BaseUIController ):
# Inspect the contents of the file to see if changeset_revision values are missing and if so, set them appropriately.
altered, root_elem, error_message = commit_util.handle_tool_dependencies_definition( trans, uploaded_file_name )
if error_message:
# Can this be displayed?
log.debug( error_message )
return False, error_message, [], '', [], []
if altered:
tmp_filename = xml_util.create_and_write_tmp_file( root_elem )
shutil.move( tmp_filename, uploaded_file_name )