X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fvimconn_vmware.py;h=f343eeac92e06e32d579d3edb8ae7d7e84cc4bf7;hb=1fa49b16e92ff2e4f512ccc466fdc3dff31559e4;hp=a20e5c92390abe95b2b4d04e1f5b9386715173e7;hpb=5f65b78751e94ef54d9cd28d27b9d7a714e096e1;p=osm%2FRO.git diff --git a/osm_ro/vimconn_vmware.py b/osm_ro/vimconn_vmware.py index a20e5c92..f343eeac 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 @@ -6482,6 +6485,7 @@ class vimconnector(vimconn.vimconnector): self.org_name)) host = self.url client = Client(host, verify_ssl_certs=False) + client.set_highest_supported_version() client.set_credentials(BasicLoginCredentials(self.user, self.org_name, self.passwd)) # connection object self.client = client