(self, host)
return s_host, s_port
Splits the host & port out of the provided SQL Server host connection string, returning (host, port).
Splits the host & port out of the provided SQL Server host connection string, returning (host, port).
Splits the host & port out of the provided SQL Server host connection string returning ( host port ) .
def split_sqlserver_host_port(self, host):
        """
        Splits the host & port out of the provided SQL Server host connection string, returning (host, port).
        """
        if not host:
            return host, None
        host_split = [s.strip() for s in host.split(',')]
        if len(host_split) == 1:
            return host_split[0], None
        if len(host_split) == 2:
            return host_split
        # else len > 2
        s_host, s_port = host_split[0:2]
        self.log.warning(
            "invalid sqlserver host string has more than one comma: %s. using only 1st two items: host:%s, port:%s",
            host,
            s_host,
            s_port,
        )
        return s_host, s_port
def split_sqlserver_host_port ( self , host ) : if not host : return host , None host_split = [ s . strip ( ) for s in host . split ( ',' ) ] if len ( host_split ) == 1 : return host_split [ 0 ] , None if len ( host_split ) == 2 : return host_split # else len > 2 s_host , s_port = host_split [ 0 : 2 ] self . log . warning ( "invalid sqlserver host string has more than one comma: %s. using only 1st two items: host:%s, port:%s" , host , s_host , s_port , ) return s_host , s_port