(self,conninfo)
return host,port,user,sslmode
Extract host,user and port from primary-conninfo
Extract host,user and port from primary-conninfo
Extract host user and port from primary - conninfo
def parse_conninfo(self,conninfo):
        """Extract host,user and port from primary-conninfo"""
        m = re.match("^.*\s*host\s*=\s*([^\s]+)\s*.*$", conninfo)
        if m:
            host = m.group(1)
        else:
            host = 'localhost'
        m =  re.match("^.*\s*user\s*=\s*([^\s]+)\s*.*$", conninfo)
        if m:
            user = m.group(1)
        else:
            user = os.environ['USER']
        m = re.match("^.*\s*port\s*=\s*([^\s]+)\s*.*$", conninfo)
        if m:
            port = m.group(1)
        else:
            port = '5432'

        m = re.match("^.*\s*sslmode\s*=\s*([^\s]+)\s*.*$", conninfo)
        if m:
            sslmode = m.group(1)
        else:
            sslmode = None

        return host,port,user,sslmode
def parse_conninfo ( self , conninfo ) : m = re . match ( "^.*\s*host\s*=\s*([^\s]+)\s*.*$" , conninfo ) if m : host = m . group ( 1 ) else : host = 'localhost' m = re . match ( "^.*\s*user\s*=\s*([^\s]+)\s*.*$" , conninfo ) if m : user = m . group ( 1 ) else : user = os . environ [ 'USER' ] m = re . match ( "^.*\s*port\s*=\s*([^\s]+)\s*.*$" , conninfo ) if m : port = m . group ( 1 ) else : port = '5432' m = re . match ( "^.*\s*sslmode\s*=\s*([^\s]+)\s*.*$" , conninfo ) if m : sslmode = m . group ( 1 ) else : sslmode = None return host , port , user , sslmode