Commit 0b090650 authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

Files get moved (not copied) if there no sending target specified

parent b84794d2
......@@ -93,10 +93,17 @@ def getMetadata (log, metadata, chunkSize, localTarget = None):
def sendData (log, targets, sourceFile, targetFile, metadata, openConnections, context, prop):
if not targets:
prop["removeFlag"] = False
targets_data = [i for i in targets if i[2] == "data"]
if not targets_data:
prop["removeFlag"] = True
return
chunkSize = metadata[ "chunkSize" ]
chunkNumber = 0
sendError = False
#reading source file into memory
try:
log.debug("Opening '" + str(sourceFile) + "'...")
......@@ -131,14 +138,13 @@ def sendData (log, targets, sourceFile, targetFile, metadata, openConnections, c
except:
log.error("Unable to pack multipart-message for file " + str(sourceFile), exc_info=True)
if targets_data:
#send message to data targets
try:
__sendToTargets(log, targets_data, sourceFile, targetFile, openConnections, None, chunkPayload, context)
log.debug("Passing multipart-message for file " + str(sourceFile) + " (chunk " + str(chunkNumber) + ")...done.")
#send message to data targets
try:
__sendToTargets(log, targets_data, sourceFile, targetFile, openConnections, None, chunkPayload, context)
log.debug("Passing multipart-message for file " + str(sourceFile) + " (chunk " + str(chunkNumber) + ")...done.")
except:
log.error("Unable to send multipart-message for file " + str(sourceFile) + " (chunk " + str(chunkNumber) + ")", exc_info=True)
except:
log.error("Unable to send multipart-message for file " + str(sourceFile) + " (chunk " + str(chunkNumber) + ")", exc_info=True)
chunkNumber += 1
......
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