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)
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)
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)
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)
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)