def format_url(url, data):
 try:
  result = (url.replace('$(', '%(') % data)
 except AttributeError:
  return None
 except KeyError as e:
  LOG.error((_('Malformed endpoint %(url)s - unknown key %(keyerror)s') % {'url': url, 'keyerror': str(e)}))
  raise exception.MalformedEndpoint(endpoint=url)
 except TypeError as e:
  LOG.error((_('Malformed endpoint %(url)s - unknown key %(keyerror)s(are you missing brackets ?)') % {'url': url, 'keyerror': str(e)}))
  raise exception.MalformedEndpoint(endpoint=url)
 except ValueError as e:
  LOG.error((_('Malformed endpoint %s - incomplete format                   (are you missing a type notifier ?)') % url))
  raise exception.MalformedEndpoint(endpoint=url)
 return result

def format_url ( url , data ) : try : result = ( url . replace ( '$(' , '%(' ) % data ) except AttributeError : return None except KeyError as e : LOG . error ( ( _ ( 'Malformed endpoint %(url)s - unknown key %(keyerror)s' ) % { 'url' : url , 'keyerror' : str ( e ) } ) ) raise exception . MalformedEndpoint ( endpoint = url ) except TypeError as e : LOG . error ( ( _ ( 'Malformed endpoint %(url)s - unknown key %(keyerror)s(are you missing brackets ?)' ) % { 'url' : url , 'keyerror' : str ( e ) } ) ) raise exception . MalformedEndpoint ( endpoint = url ) except ValueError as e : LOG . error ( ( _ ( 'Malformed endpoint %s - incomplete format                   (are you missing a type notifier ?)' ) % url ) ) raise exception . MalformedEndpoint ( endpoint = url ) return result
helper method for all backend catalogs to deal with urls .