mirror of
https://github.com/vmware/vsphere-automation-sdk-python.git
synced 2024-11-22 01:39:58 -05:00
Fix pylint warning raise-missing-from
Signed-off-by: Ratish Thakoersingh <r.k.thakoersingh@student.tudelft.nl>
This commit is contained in:
parent
99ee630cb8
commit
96a3ba588d
@ -84,7 +84,7 @@ class DeployAdditionalInstance(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.draas.Task,
|
wait_for_task(task_client=self.vmc_client.draas.Task,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
@ -103,7 +103,7 @@ class DeployAdditionalInstance(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.draas.Task,
|
wait_for_task(task_client=self.vmc_client.draas.Task,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
|
@ -70,7 +70,7 @@ class SiteRecoveryActivationOperations(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.draas.Task,
|
wait_for_task(task_client=self.vmc_client.draas.Task,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
@ -87,7 +87,7 @@ class SiteRecoveryActivationOperations(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.draas.Task,
|
wait_for_task(task_client=self.vmc_client.draas.Task,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
|
@ -83,7 +83,7 @@ class AddRemoveHosts(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.orgs.Tasks,
|
wait_for_task(task_client=self.vmc_client.orgs.Tasks,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
@ -103,7 +103,7 @@ class AddRemoveHosts(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(task_client=self.vmc_client.orgs.Tasks,
|
wait_for_task(task_client=self.vmc_client.orgs.Tasks,
|
||||||
org_id=self.org_id,
|
org_id=self.org_id,
|
||||||
|
@ -59,7 +59,7 @@ class ConnectTovSphereWithDefaultCredentials(object):
|
|||||||
sddc = vmc_client.orgs.Sddcs.get(self.org_id, self.sddc_id)
|
sddc = vmc_client.orgs.Sddcs.get(self.org_id, self.sddc_id)
|
||||||
except NotFound as e:
|
except NotFound as e:
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise ValueError(error_response.error_messages)
|
raise ValueError(error_response.error_messages) from e
|
||||||
|
|
||||||
# Get VC hostname
|
# Get VC hostname
|
||||||
server = parse.urlparse(sddc.resource_config.vc_url).hostname
|
server = parse.urlparse(sddc.resource_config.vc_url).hostname
|
||||||
|
@ -155,7 +155,7 @@ class CreateDeleteSDDC(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(
|
wait_for_task(
|
||||||
task_client=self.vmc_client.orgs.Tasks,
|
task_client=self.vmc_client.orgs.Tasks,
|
||||||
@ -187,7 +187,7 @@ class CreateDeleteSDDC(object):
|
|||||||
except InvalidRequest as e:
|
except InvalidRequest as e:
|
||||||
# Convert InvalidRequest to ErrorResponse to get error message
|
# Convert InvalidRequest to ErrorResponse to get error message
|
||||||
error_response = e.data.convert_to(ErrorResponse)
|
error_response = e.data.convert_to(ErrorResponse)
|
||||||
raise Exception(error_response.error_messages)
|
raise Exception(error_response.error_messages) from e
|
||||||
|
|
||||||
wait_for_task(
|
wait_for_task(
|
||||||
task_client=self.vmc_client.orgs.Tasks,
|
task_client=self.vmc_client.orgs.Tasks,
|
||||||
|
Loading…
Reference in New Issue
Block a user