Esempio n. 1
0
File: cmd.py Progetto: zurikus/wal-e
import re
import subprocess
import textwrap
import traceback

from wal_e import log_help

from wal_e.exception import UserCritical
from wal_e.exception import UserException
from wal_e import storage
from wal_e.piper import popen_sp
from wal_e.worker.pg import PSQL_BIN, psql_csv_run
from wal_e.pipeline import LZOP_BIN, PV_BIN, GPG_BIN
from wal_e.worker.pg import CONFIG_BIN, PgControlDataParser

log_help.configure(format='%(name)-12s %(levelname)-8s %(message)s')

logger = log_help.WalELogger('wal_e.main')


def external_program_check(to_check=frozenset([PSQL_BIN, LZOP_BIN, PV_BIN])):
    """
    Validates the existence and basic working-ness of other programs

    Implemented because it is easy to get confusing error output when
    one does not install a dependency because of the fork-worker model
    that is both necessary for throughput and makes more obscure the
    cause of failures.  This is intended to be a time and frustration
    saving measure.  This problem has confused The Author in practice
    when switching rapidly between machines.
Esempio n. 2
0
def test_nonexisting_socket(tmpdir, monkeypatch):
    # Must not raise an exception, silently failing is preferred for
    # now.
    monkeypatch.setattr(log_help, 'HANDLERS', [])
    log_help.configure(syslog_address=tmpdir.join('bogus'))
Esempio n. 3
0
import re
import sys
import textwrap
import traceback

import wal_e.log_help as log_help

from wal_e import subprocess
from wal_e.exception import UserException
from wal_e.operator import s3_operator
from wal_e.pipeline import LZOP_BIN, PV_BIN, GPG_BIN
from wal_e.piper import popen_sp
from wal_e.worker.pg_controldata_worker import CONFIG_BIN, PgControlDataParser
from wal_e.worker.psql_worker import PSQL_BIN, psql_csv_run

log_help.configure(
    format='%(name)-12s %(levelname)-8s %(message)s')

logger = log_help.WalELogger('wal_e.main', level=logging.INFO)


def external_program_check(
    to_check=frozenset([PSQL_BIN, LZOP_BIN, PV_BIN])):
    """
    Validates the existence and basic working-ness of other programs

    Implemented because it is easy to get confusing error output when
    one does not install a dependency because of the fork-worker model
    that is both necessary for throughput and makes more obscure the
    cause of failures.  This is intended to be a time and frustration
    saving measure.  This problem has confused The Author in practice
    when switching rapidly between machines.
Esempio n. 4
0
def test_nonexisting_socket(tmpdir):
    # Must not raise an exception, silently failing is preferred for
    # now.
    log_help.configure(syslog_address=tmpdir.join('bogus'))
Esempio n. 5
0
def test_nonexisting_socket(tmpdir, monkeypatch):
    # Must not raise an exception, silently failing is preferred for
    # now.
    monkeypatch.setattr(log_help, 'HANDLERS', [])
    log_help.configure(syslog_address=tmpdir.join('bogus'))
Esempio n. 6
0
def test_nonexisting_socket(tmpdir):
    # Must not raise an exception, silently failing is preferred for
    # now.
    log_help.configure(syslog_address=tmpdir.join('bogus'))
Esempio n. 7
0
import sys
import tempfile
import textwrap

import wal_e.worker as worker
import wal_e.tar_partition as tar_partition
import wal_e.log_help as log_help

from wal_e.exception import UserException, UserCritical
from wal_e.piper import popen_sp
from wal_e.worker import PSQL_BIN, ENCODE_BIN, DECODE_BIN, S3CMD_BIN, MBUFFER_BIN
from wal_e.worker import check_call_wait_sigint

# TODO: Make controllable from userland
log_help.configure(
    level=logging.DEBUG,
    format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s')

logger = log_help.get_logger('wal_e.main')

# Provides guidence in object names as to the version of the file
# structure.
FILE_STRUCTURE_VERSION = '005'


class UTC(datetime.tzinfo):
    """
    UTC timezone

    Adapted from a Python example
Esempio n. 8
0
File: cmd.py Progetto: f0rk/WAL-E
import re
import subprocess
import sys
import textwrap
import traceback

import wal_e.log_help as log_help

from wal_e.exception import UserException
from wal_e.operator import s3_operator
from wal_e.piper import popen_sp
from wal_e.worker.psql_worker import PSQL_BIN, psql_csv_run
from wal_e.pipeline import LZOP_BIN, PV_BIN, GPG_BIN

# TODO: Make controllable from userland
log_help.configure(format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s")

logger = log_help.WalELogger("wal_e.main", level=logging.INFO)


def external_program_check(to_check=frozenset([PSQL_BIN, LZOP_BIN, PV_BIN])):
    """
    Validates the existence and basic working-ness of other programs

    Implemented because it is easy to get confusing error output when
    one does not install a dependency because of the fork-worker model
    that is both necessary for throughput and makes more obscure the
    cause of failures.  This is intended to be a time and frustration
    saving measure.  This problem has confused The Author in practice
    when switching rapidly between machines.