From d7775859b463ada7273e128c188ec87317e39e89 Mon Sep 17 00:00:00 2001
From: Kenneth Giusti <kgiusti@gmail.com>
Date: Thu, 23 Mar 2017 15:36:27 -0400
Subject: [PATCH] Break user credentials from host at the rightmost '@'

The rightmost '@' in a url netloc field separates the user:password
from the hostname:port.  Using the first may cause the separation to
occur in the username or password field (if unencoded).

Change-Id: I7b02d8e0cbdf875ea80a55065ce98fa73696e05f
Closes-Bug: 1675423
---
 oslo_messaging/transport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/oslo_messaging/transport.py b/oslo_messaging/transport.py
index 556529ff8..b62ab1c4f 100644
--- a/oslo_messaging/transport.py
+++ b/oslo_messaging/transport.py
@@ -432,7 +432,7 @@ class TransportURL(object):
             username = password = port = None
 
             if '@' in host:
-                username, hostname = host.split('@', 1)
+                username, hostname = host.rsplit('@', 1)
                 if ':' in username:
                     username, password = username.split(':', 1)
                     password = parse.unquote(password)