Example #1
0
    def config_template(self):
        # NOTE: we set pg_receivexlog_path and pg_basebackup_path per site and globally mostly to verify that
        # it works, the config keys are deprecated and will be removed in a future release at which point we'll
        # switch to using pg_bin_directory config.
        bindir = find_pg_binary("")

        if hasattr(psycopg2.extras, "PhysicalReplicationConnection"):
            active_backup_mode = "walreceiver"
        else:
            active_backup_mode = "pg_receivexlog"

        config = {
            "alert_file_dir": os.path.join(str(self.temp_dir), "alerts"),
            "backup_location": os.path.join(str(self.temp_dir), "backupspool"),
            "backup_sites": {
                self.test_site: {
                    "active_backup_mode": active_backup_mode,
                    "object_storage": {
                        "storage_type": "local",
                        "directory": os.path.join(self.temp_dir, "backups"),
                    },
                    "pg_receivexlog_path": os.path.join(bindir, "pg_receivexlog"),
                },
            },
            "json_state_file_path": os.path.join(self.temp_dir, "state.json"),
            "pg_basebackup_path": os.path.join(bindir, "pg_basebackup"),
        }
        return set_config_defaults(config)
Example #2
0
 def config_template(self):
     bindir = TestPG.find_pgbin()
     config = {
         "alert_file_dir": os.path.join(str(self.temp_dir), "alerts"),
         "backup_location": os.path.join(str(self.temp_dir), "backups"),
         "backup_sites": {
             self.test_site: {
                 "object_storage": {
                     "storage_type": "local",
                     "directory": os.path.join(self.temp_dir, "backups"),
                 },
             },
         },
         "json_state_file_path": os.path.join(self.temp_dir, "state.json"),
         "pg_basebackup_path": os.path.join(bindir, "pg_basebackup"),
         "pg_receivexlog_path": os.path.join(bindir, "pg_receivexlog"),
     }
     return set_config_defaults(config)