diff options
author | Bin Yang <bin.yang@windriver.com> | 2019-08-20 10:01:12 +0000 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2019-08-21 03:02:23 +0000 |
commit | fbc00166dc021898a1a7dfb98672ec3bc28851b9 (patch) | |
tree | 789c60af42a259a5fb58753dc9e4485aea95db87 /share/starlingx_base | |
parent | 4c33dac9a6735b07c5e7e0d2f67baa2f5eaeed97 (diff) |
Update windriver plugin to py3
Change-Id: I7bb1591a31de777d59ad1b96246bbc4d8e1f86f4
Issue-ID: MULTICLOUD-774
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/starlingx_base')
-rw-r--r-- | share/starlingx_base/registration/registration.py | 8 | ||||
-rw-r--r-- | share/starlingx_base/resource/infra_workload.py | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/share/starlingx_base/registration/registration.py b/share/starlingx_base/registration/registration.py index b6ed9250..85d3faa0 100644 --- a/share/starlingx_base/registration/registration.py +++ b/share/starlingx_base/registration/registration.py @@ -229,26 +229,26 @@ class RegistryHelper(newton_registration.RegistryHelper): self._update_cloud_region( cloud_owner, gen_cloud_region_id, regionid, viminfo) except Exception as e: - self._logger.debug("update cloud region fails %s" % e.message) + self._logger.debug("update cloud region fails %s" % str(e)) try: new_vimid = extsys.encode_vim_id( cloud_owner, gen_cloud_region_id) super(RegistryHelper, self).registryV0(new_vimid, project_idorname) except Exception as e: - self._logger.debug("registryV0 fails %s" % e.message) + self._logger.debug("registryV0 fails %s" % str(e)) # update the specified region try: self._update_cloud_region(cloud_owner, cloud_region_id, region_specified, viminfo) except Exception as e: - self._logger.debug("update cloud region fails %s" % e.message) + self._logger.debug("update cloud region fails %s" % str(e)) try: super(RegistryHelper, self).registryV0(vimid, project_idorname) except Exception as e: - self._logger.debug("registryV0 fails %s" % e.message) + self._logger.debug("registryV0 fails %s" % str(e)) return 0 diff --git a/share/starlingx_base/resource/infra_workload.py b/share/starlingx_base/resource/infra_workload.py index 9524d673..5020af94 100644 --- a/share/starlingx_base/resource/infra_workload.py +++ b/share/starlingx_base/resource/infra_workload.py @@ -139,12 +139,12 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): status_code = status.HTTP_202_ACCEPTED\ if progress_code == 0 else progress_code except Exception as e: - self._logger.warn("Exception: %s" % e.message) + self._logger.warn("Exception: %s" % str(e)) resp_template["workload_status_reason"] = progress return Response(data=resp_template, status=status_code) except Exception as e: - errmsg = e.message + errmsg = str(e) self._logger.error(errmsg) resp_template["workload_status_reason"] = errmsg return Response(data=resp_template, @@ -252,8 +252,8 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): return Response(data=resp_template, status=status_code) except Exception as e: - self._logger.error(e.message) - resp_template["workload_status_reason"] = e.message + self._logger.error(str(e)) + resp_template["workload_status_reason"] = str(e) return Response(data=resp_template, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @@ -339,8 +339,8 @@ class InfraWorkload(newton_infra_workload.InfraWorkload): resp_template["workload_status_reason"] = progress return Response(data=resp_template, status=status_code) except Exception as e: - self._logger.error(e.message) - resp_template["workload_status_reason"] = e.message + self._logger.error(str(e)) + resp_template["workload_status_reason"] = str(e) return Response(data=resp_template, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @@ -486,7 +486,7 @@ class InfraWorkloadHelper(infra_workload_helper.InfraWorkloadHelper): self._logger.info("artifacts not available for vfmodule %s" % vf_module_model_customization_id) pass except Exception as e: - self._logger.error("template_update fails: %s" % e.message) + self._logger.error("template_update fails: %s" % str(e)) # try 2: reuse the input: template_data return template_data |