diff options
| author | Pavel Moravec <pmoravec@apache.org> | 2014-07-01 14:09:05 +0000 |
|---|---|---|
| committer | Pavel Moravec <pmoravec@apache.org> | 2014-07-01 14:09:05 +0000 |
| commit | 007148cc84d5338ea691869708f946f415dabac8 (patch) | |
| tree | 6c0ec0649ccc10a183a95a7d6ba24d8eff056a81 /python | |
| parent | 6063de9cb79bde219255eb92d6f0f27448eb60bd (diff) | |
| download | qpid-python-007148cc84d5338ea691869708f946f415dabac8.tar.gz | |
[QPID-5864]: [Python client] Provide better error description when SASL required but no credentials provided
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1607086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/messaging/driver.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py index 2e27fdb421..e8ab964f0e 100644 --- a/python/qpid/messaging/driver.py +++ b/python/qpid/messaging/driver.py @@ -723,7 +723,11 @@ class Engine: try: mech, initial = self._sasl.start(" ".join(mechs)) except sasl.SASLError, e: - raise AuthenticationFailure(text=str(e)) + if "ANONYMOUS" not in mechs and self.connection.username is None: + _text="Anonymous connections disabled, missing credentials" + else: + _text=str(e) + raise AuthenticationFailure(text=_text) client_properties = get_client_properties_with_defaults(provided_client_properties=self.connection.client_properties); self.write_op(ConnectionStartOk(client_properties=client_properties, |
