예제 #1
0
def connect_simple(config):
    """Create a MySQLClientConnection given a mysql:client config
    section from a holland mysql backupset
    """
    try:
        mysql_config = build_mysql_config(config)
        LOG.debug("mysql_config => %r", mysql_config)
        connection = connect(mysql_config['client'], PassiveMySQLClient)
        connection.connect()
        return connection
    except MySQLError, exc:
        raise BackupError("[%d] %s" % exc.args)
예제 #2
0
파일: common.py 프로젝트: osheroff/holland
def connect_simple(config):
    """Create a MySQLClientConnection given a mysql:client config
    section from a holland mysql backupset
    """
    try:
        mysql_config = build_mysql_config(config)
        LOG.debug("mysql_config => %r", mysql_config)
        connection = connect(mysql_config["client"], PassiveMySQLClient)
        connection.connect()
        return connection
    except MySQLError, exc:
        raise BackupError("[%d] %s" % exc.args)
예제 #3
0
def connect_simple(config):
    """Create a MySQLClientConnection given a mysql:client config
    section from a holland mysql backupset
    """
    try:
        mysql_config = build_mysql_config(config)
        connection = connect(mysql_config['client'], PassiveMySQLClient)
        sanitized = copy.deepcopy(mysql_config)
        sanitized['client']['password'] = "******"
        LOG.debug("mysql_config => %s", sanitized)
        connection.connect()
        return connection
    except MySQLError as exc:
        raise BackupError("[%d] %s" % exc.args)
예제 #4
0
def connect_simple(config):
    """Create a MySQLClientConnection given a mysql:client config
    section from a holland mysql backupset
    """
    try:
        mysql_config = build_mysql_config(config)
        connection = connect(mysql_config["client"], MySQLClient)
        sanitized = copy.deepcopy(mysql_config)
        sanitized["client"]["password"] = "******"
        LOG.debug("mysql_config => %s", sanitized)
        connection.connect()
        return connection
    except MySQLError as exc:
        raise BackupError("[%d] %s" % exc.args)
예제 #5
0
def connect_simple(config):
    """Create a MySQLClientConnection given a mysql:client config
    section from a holland mysql backupset
    """
    try:
        mysql_config = build_mysql_config(config)
        sanitized = {k: v for k, v in mysql_config.items()}
        if 'password' in mysql_config.keys():
            sanitized['password'] = "******"
        LOG.debug("mysql_config => %r", sanitized)
        connection = connect(mysql_config['client'], PassiveMySQLClient)
        connection.connect()
        return connection
    except MySQLError, exc:
        raise BackupError("[%d] %s" % exc.args)