diff options
author | 2016-06-15 15:57:01 -0700 | |
---|---|---|
committer | 2016-06-15 15:57:01 -0700 | |
commit | 256171bb7b47bd3812425a8b506295ec91148012 (patch) | |
tree | a70d6c3cf627ce975d6e31b3186e57f865ac7aa4 /DominoServer.py | |
parent | 28dc1f7574e1fdd2fbfd49feec3dcc559c43ad04 (diff) |
Publish routine turns FAILED status when distribution or translation fails
Change-Id: Ie66dbd2edfa9ab28e21701b3ac79242c7d5c507e
Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'DominoServer.py')
-rwxr-xr-x | DominoServer.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/DominoServer.py b/DominoServer.py index c7d58ef..cdb2fa1 100755 --- a/DominoServer.py +++ b/DominoServer.py @@ -286,7 +286,13 @@ class CommunicationHandler: # Create work-flow - + # Create response with response code as SUCCESS by default + # Response code will be overwrittent if partial or full failure occurs + pub_r = PublishResponseMessage() + pub_r.domino_udid = SERVER_UDID + pub_r.seq_no = self.seqno + pub_r.responseCode = SUCCESS + self.seqno = self.seqno + 1 # Send domain templates to each domain agent/client # FOR NOW: send untranslated but partitioned tosca files to scheduled sites @@ -306,15 +312,11 @@ class CommunicationHandler: self.push_template(template_lines, domino_client_ip, domino_client_port) except IOError as e: logging.error('I/O error(%d): %s' , e.errno, e.strerror) + pub_r.responseCode = FAILED except: logging.error('Error: %s', sys.exc_info()[0]) + pub_r.responseCode = FAILED - #Fill in the details - pub_r = PublishResponseMessage() - pub_r.domino_udid = SERVER_UDID - pub_r.seq_no = self.seqno - pub_r.responseCode = SUCCESS - self.seqno = self.seqno + 1 return pub_r #Query from Domino Client is received |