]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
validate: fix notario error
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 23 Apr 2019 13:19:26 +0000 (15:19 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 23 Apr 2019 13:47:42 +0000 (09:47 -0400)
Typical error:

```
AttributeError: 'Invalid' object has no attribute 'message'
```

As of python 2.6, `BaseException.message` has been deprecated.
When using python3, it fails because it has been removed.

Let's use `str(error)` instead so we don't hit this error when using
python3.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 2326180bf98ef311ebddb8c6e18d83ae819cd29f)

plugins/actions/validate.py

index ebedd3ed89448fdab8e53a9832d25cbf6ce6e0ce..4c979f43582487521a5d32de4e6ddc1297bd066c 100644 (file)
@@ -111,7 +111,7 @@ class ActionModule(ActionBase):
             display.error(msg)
             reason = "[{}] Reason: {}".format(host, error.reason)
             try:
-                if "schema is missing" not in error.message:
+                if "schema is missing" not str(error):
                     for i in range(0, len(error.path)):
                         if i == 0:
                             given = "[{}] Given value for {}".format(