fix handling storage errors

We tried to access a wrong attribute of the exception.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/84b811c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/84b811c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/84b811c3

Branch: refs/heads/ARIA-48-aria-cli
Commit: 84b811c38843b808277aabb16a76f5809b81a6f8
Parents: a26f245
Author: Avia Efrat <[email protected]>
Authored: Mon Apr 3 17:10:17 2017 +0300
Committer: Ran Ziv <[email protected]>
Committed: Tue Apr 4 13:20:46 2017 +0300

----------------------------------------------------------------------
 aria/cli/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/84b811c3/aria/cli/utils.py
----------------------------------------------------------------------
diff --git a/aria/cli/utils.py b/aria/cli/utils.py
index fff8e3a..950c295 100644
--- a/aria/cli/utils.py
+++ b/aria/cli/utils.py
@@ -153,7 +153,7 @@ def generate_progress_handler(file_path, action='', 
max_bar_length=80):
 
 
 def handle_storage_exception(e, model_class, name):
-    if 'UNIQUE constraint failed' in e.msg:
+    if 'UNIQUE constraint failed' in e.message:
         msg = 'Could not store {model_class} `{name}`\n' \
               'There already a exists a {model_class} with the same name' \
               .format(model_class=model_class, name=name)

Reply via email to