import six


def get_url_str(scheme, name, port):
    """
    Create displayable output for url based on scheme, name, an ports based
    on knowledge that this is WBEM.  If the ports are the standard ports
    the port component is ignored
    """
    if isinstance(port, six.string_types):
        port = int(port)
    if (scheme == 'https' and port == 5989) or \
       (scheme == 'http' and port == 5988):
        url = '%s://%s' % (scheme, name)
    else:
        url = '%s://%s:%s' % (scheme, name, port)
    return url