From 96a3ba588db2531fcf0e83de5bb2366b7ca23a03 Mon Sep 17 00:00:00 2001 From: RatishT Date: Wed, 26 Jun 2024 10:10:28 +0200 Subject: [PATCH] Fix pylint warning `raise-missing-from` Signed-off-by: Ratish Thakoersingh --- samples/vmc/draas/deploy_additional_instance.py | 4 ++-- samples/vmc/draas/site_recovery_activation_ops.py | 4 ++-- samples/vmc/sddc/add_remove_hosts.py | 4 ++-- .../vmc/sddc/connect_to_vsphere_with_default_sddc_password.py | 2 +- samples/vmc/sddc/sddc_crud.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/vmc/draas/deploy_additional_instance.py b/samples/vmc/draas/deploy_additional_instance.py index c2570664..005f781a 100644 --- a/samples/vmc/draas/deploy_additional_instance.py +++ b/samples/vmc/draas/deploy_additional_instance.py @@ -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, diff --git a/samples/vmc/draas/site_recovery_activation_ops.py b/samples/vmc/draas/site_recovery_activation_ops.py index 31296a2a..c524fea0 100644 --- a/samples/vmc/draas/site_recovery_activation_ops.py +++ b/samples/vmc/draas/site_recovery_activation_ops.py @@ -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, diff --git a/samples/vmc/sddc/add_remove_hosts.py b/samples/vmc/sddc/add_remove_hosts.py index e15efd49..fa57eaa8 100644 --- a/samples/vmc/sddc/add_remove_hosts.py +++ b/samples/vmc/sddc/add_remove_hosts.py @@ -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, diff --git a/samples/vmc/sddc/connect_to_vsphere_with_default_sddc_password.py b/samples/vmc/sddc/connect_to_vsphere_with_default_sddc_password.py index b6dcc7fb..9055d461 100644 --- a/samples/vmc/sddc/connect_to_vsphere_with_default_sddc_password.py +++ b/samples/vmc/sddc/connect_to_vsphere_with_default_sddc_password.py @@ -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 diff --git a/samples/vmc/sddc/sddc_crud.py b/samples/vmc/sddc/sddc_crud.py index f96f1956..ff8e2cc7 100644 --- a/samples/vmc/sddc/sddc_crud.py +++ b/samples/vmc/sddc/sddc_crud.py @@ -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,