1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-25 10:50:00 -05:00

Fix pylint warning raise-missing-from

This commit is contained in:
RatishT 2024-06-26 10:10:28 +02:00
parent 99ee630cb8
commit e35bef6eb0
5 changed files with 9 additions and 9 deletions

View File

@ -84,7 +84,7 @@ class DeployAdditionalInstance(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,
@ -103,7 +103,7 @@ class DeployAdditionalInstance(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,

View File

@ -70,7 +70,7 @@ class SiteRecoveryActivationOperations(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,
@ -87,7 +87,7 @@ class SiteRecoveryActivationOperations(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,

View File

@ -83,7 +83,7 @@ class AddRemoveHosts(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,
@ -103,7 +103,7 @@ class AddRemoveHosts(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
org_id=self.org_id,

View File

@ -59,7 +59,7 @@ class ConnectTovSphereWithDefaultCredentials(object):
sddc = vmc_client.orgs.Sddcs.get(self.org_id, self.sddc_id)
except NotFound as e:
error_response = e.data.convert_to(ErrorResponse)
raise ValueError(error_response.error_messages)
raise ValueError(error_response.error_messages) from e
# Get VC hostname
server = parse.urlparse(sddc.resource_config.vc_url).hostname

View File

@ -155,7 +155,7 @@ class CreateDeleteSDDC(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,
@ -187,7 +187,7 @@ class CreateDeleteSDDC(object):
except InvalidRequest as e:
# Convert InvalidRequest to ErrorResponse to get error message
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,