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/08eb48b5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/08eb48b5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/08eb48b5 Branch: refs/heads/ARIA-48-aria-cli Commit: 08eb48b529b470781abb094659188772d9d47158 Parents: 885e096 Author: Avia Efrat <[email protected]> Authored: Mon Apr 3 17:10:17 2017 +0300 Committer: Ran Ziv <[email protected]> Committed: Thu Apr 6 11:29:17 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/08eb48b5/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)
