diff options
author | Zhao Chao <zhaochao1984@gmail.com> | 2018-01-12 15:54:08 +0800 |
---|---|---|
committer | Zhao Chao <zhaochao1984@gmail.com> | 2018-01-12 19:48:10 +0800 |
commit | 5abbdc9b59c1bc33f13c7467626f5c6ea4f049e5 (patch) | |
tree | 52ac43648d9ddc9a40b690d5dd3648b148e92a41 /trove/extensions | |
parent | 7061c37854b7f1624d5500e93394c6501a9d6616 (diff) | |
download | trove-5abbdc9b59c1bc33f13c7467626f5c6ea4f049e5.tar.gz |
Initialize BadRequest exception with correct message.
Currently some BadRequest exceptions are raised with a wrong
argument 'msg', this leads to totally helpless informations
returned by the API when errors occurr. This patch fixes
the problem.
Change-Id: Ifd821e8297a44fd0b25f879f79fe6a2456c1d8a5
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
Diffstat (limited to 'trove/extensions')
-rw-r--r-- | trove/extensions/common/service.py | 2 | ||||
-rw-r--r-- | trove/extensions/security_group/service.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/trove/extensions/common/service.py b/trove/extensions/common/service.py index 97cf7bde..7023f1f6 100644 --- a/trove/extensions/common/service.py +++ b/trove/extensions/common/service.py @@ -122,7 +122,7 @@ class DefaultRootController(BaseDatastoreRootController): try: found_user = self._find_root_user(context, instance_id) except (ValueError, AttributeError) as e: - raise exception.BadRequest(msg=str(e)) + raise exception.BadRequest(message=str(e)) if not found_user: raise exception.UserNotFound(uuid="root") models.Root.delete(context, instance_id) diff --git a/trove/extensions/security_group/service.py b/trove/extensions/security_group/service.py index 3a4a837d..99073dc4 100644 --- a/trove/extensions/security_group/service.py +++ b/trove/extensions/security_group/service.py @@ -111,7 +111,7 @@ class SecurityGroupRuleController(wsgi.Controller): CONF.os_region_name) rules.append(rule) except (ValueError, AttributeError) as e: - raise exception.BadRequest(msg=str(e)) + raise exception.BadRequest(message=str(e)) return rules tcp_rules = _create_rules(sec_group, tcp_ports, 'tcp') |