From a9edb7cfb64dfa3f26f4dd81b82d212ce5aa4c91 Mon Sep 17 00:00:00 2001 From: zengchen Date: Tue, 28 Mar 2017 18:00:02 +0800 Subject: [PATCH] Fix: reference an undefined attribute of 'msg' of Exception Change-Id: Ie1b0d61ba9e9118ca92240fa844c025b98a42d82 Closes-Bug: #1676804 --- karbor/api/v1/providers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/karbor/api/v1/providers.py b/karbor/api/v1/providers.py index 34a86254..0639458c 100644 --- a/karbor/api/v1/providers.py +++ b/karbor/api/v1/providers.py @@ -421,8 +421,9 @@ class ProvidersController(wsgi.Controller): checkpoint_id = self.protection_api.protect(context, plan, checkpoint_properties) except Exception as error: - msg = _("Create checkpoint failed: %s") % error.msg + msg = _("Create checkpoint failed: %s") % error raise exc.HTTPBadRequest(explanation=msg) + checkpoint_properties['id'] = checkpoint_id LOG.info("Create the checkpoint successfully. checkpoint_id:%s",