Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding a couple of external program checks

  • Loading branch information...
commit b5d3e6b3dd83cd5f8e413a1467571dde0140f0f2 1 parent c5ed0b1
@mikeyk authored
Showing with 16 additions and 1 deletion.
  1. +13 −1 wal_e/cmd.py
  2. +3 −0  wal_e/worker/pg_controldata_worker.py
View
14 wal_e/cmd.py
@@ -33,6 +33,7 @@ def gevent_monkey(*args, **kwargs):
from wal_e.piper import popen_sp
from wal_e.worker.psql_worker import PSQL_BIN, psql_csv_run
from wal_e.worker.s3_worker import LZOP_BIN, MBUFFER_BIN
+from wal_e.worker.pg_controldata_worker import CONFIG_BIN, PgControlDataParser
# TODO: Make controllable from userland
log_help.configure(
@@ -294,7 +295,18 @@ def main(argv=None):
elif subcommand == 'backup-list':
backup_cxt.backup_list(query=args.QUERY, detail=args.detail)
elif subcommand == 'backup-push':
- external_programs = [LZOP_BIN, PSQL_BIN, MBUFFER_BIN] if not args.pg_is_stopped_replica else [LZOP_BIN, MBUFFER_BIN]
+ if args.pg_is_stopped_replica:
+ # we need to query pg_config first for the
+ # pg_controldata's bin location
+ external_program_check([CONFIG_BIN])
+ parser = PgControlDataParser(args.PG_CLUSTER_DIRECTORY)
+ controldata_bin = parser.controldata_bin()
+ external_programs = [
+ LZOP_BIN,
+ MBUFFER_BIN,
+ controldata_bin]
+ else:
+ external_programs = [LZOP_BIN, PSQL_BIN, MBUFFER_BIN]
external_program_check(external_programs)
rate_limit = args.rate_limit
if rate_limit is not None and rate_limit < 8192:
View
3  wal_e/worker/pg_controldata_worker.py
@@ -44,6 +44,9 @@ def _read_controldata(self):
controldata[key.strip()] = val.strip()
return controldata
+ def controldata_bin(self):
+ return self._controldata_bin
+
def pg_version(self):
return self._pg_version
Please sign in to comment.
Something went wrong with that request. Please try again.