def cleanup_repo_url(url):
 parsed = urlparse(url)
 if (parsed.username and parsed.password):
  return url.replace(u'{0}:{1}@'.format(parsed.username, parsed.password), u'')
 elif parsed.username:
  return url.replace(u'{0}@'.format(parsed.username), u'')
 return url

def cleanup_repo_url ( url ) : parsed = urlparse ( url ) if ( parsed . username and parsed . password ) : return url . replace ( u'{0}:{1}@' . format ( parsed . username , parsed . password ) , u'' ) elif parsed . username : return url . replace ( u'{0}@' . format ( parsed . username ) , u'' ) return url
removes credentials from repository url .