Register opts if we're going to check conf.transport_url in parse()

In TransportURL.parse(), a classmethod, we expect conf.transport_url
to be accessible if a url is not passed in. However, since the
_transport_opts are not registered yet, that will fail, which is
a pretty easy case to hit if we're constructing our TransportURL
for the first time on startup.

This registers the opts if we're likely to hit it.

Change-Id: Id94bc0a7fec3ce536e134d4f162ac253a775b238
This commit is contained in:
Dan Smith 2016-11-28 14:16:39 -08:00
parent d13ccf2114
commit 485986d5ae

@ -395,6 +395,8 @@ class TransportURL(object):
:returns: A TransportURL
"""
if not url:
conf.register_opts(_transport_opts)
url = url or conf.transport_url
if not url:
return cls(conf, aliases=aliases)