1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-22 09:39:58 -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: 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,

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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,