From: Ananda Baitharu Date: Tue, 18 Jun 2019 13:53:37 +0000 (+0000) Subject: Bug 778 Wait on the upload iso task X-Git-Tag: v6.0.1~2^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F7675%2F1;p=osm%2FRO.git Bug 778 Wait on the upload iso task Change-Id: I8a4cead515fbab1a8bd267649b8e6c46b942a1ec Signed-off-by: Ananda Baitharu --- diff --git a/osm_ro/vimconn_vmware.py b/osm_ro/vimconn_vmware.py index a20e5c92..77ac5676 100644 --- a/osm_ro/vimconn_vmware.py +++ b/osm_ro/vimconn_vmware.py @@ -2200,7 +2200,7 @@ class vimconnector(vimconn.vimconnector): media_upload_href = match.group(1) else: raise Exception('Could not parse the upload URL for the media file from the last response') - + upload_iso_task = self.get_task_from_response(response.content) headers['Content-Type'] = 'application/octet-stream' response = self.perform_request(req_type='PUT', url=media_upload_href, @@ -2209,6 +2209,9 @@ class vimconnector(vimconn.vimconnector): if response.status_code != 200: raise Exception('PUT request to "{}" failed'.format(media_upload_href)) + result = self.client.get_task_monitor().wait_for_success(task=upload_iso_task) + if result.get('status') != 'success': + raise Exception('The upload iso task failed with status {}'.format(result.get('status'))) def get_vcd_availibility_zones(self,respool_href, headers): """ Method to find presence of av zone is VIM resource pool