def get_transport(conf, url=None, optional=False, cache=True):
 global TRANSPORTS, DEFAULT_URL
 cache_key = (url or DEFAULT_URL)
 transport = TRANSPORTS.get(cache_key)
 if ((not transport) or (not cache)):
  try:
   transport = oslo_messaging.get_transport(conf, url)
  except (oslo_messaging.InvalidTransportURL, oslo_messaging.DriverLoadFailure):
   if ((not optional) or url):
    raise
   return None
  else:
   if cache:
    TRANSPORTS[cache_key] = transport
 return transport

def get_transport ( conf , url = None , optional = False , cache = True ) : global TRANSPORTS , DEFAULT_URL cache_key = ( url or DEFAULT_URL ) transport = TRANSPORTS . get ( cache_key ) if ( ( not transport ) or ( not cache ) ) : try : transport = oslo_messaging . get_transport ( conf , url ) except ( oslo_messaging . InvalidTransportURL , oslo_messaging . DriverLoadFailure ) : if ( ( not optional ) or url ) : raise return None else : if cache : TRANSPORTS [ cache_key ] = transport return transport
initialise the oslo_messaging layer .