Skip to content

Commit 549c57a

Browse files
Rename of conf file, port fix for Nsca, etc
1 parent 8b960bb commit 549c57a

File tree

9 files changed

+20
-18
lines changed

9 files changed

+20
-18
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ install: bin/mongodb-consistent-backup
1818
rm -rf bin build 2>/dev/null
1919
mkdir -p $(BINDIR) $(SHAREDIR)/$(NAME) || true
2020
install -m 0755 bin/mongodb-consistent-backup $(BINDIR)/mongodb-consistent-backup
21-
install -m 0644 conf/mongodb-consistent-backup.example.yml $(SHAREDIR)/$(NAME)/example.yml
21+
install -m 0644 conf/mongodb-consistent-backup.example.conf $(SHAREDIR)/$(NAME)/example.conf
2222
install -m 0644 LICENSE $(SHAREDIR)/$(NAME)/LICENSE
2323
install -m 0644 README.rst $(SHAREDIR)/$(NAME)/README.rst
2424

@@ -31,7 +31,7 @@ rpm: bin/mongodb-consistent-backup
3131
mkdir -p build/rpm/SOURCES
3232
cp -f $(PWD)/{LICENSE,README.rst} build/rpm/SOURCES
3333
cp -f $(PWD)/bin/mongodb-consistent-backup build/rpm/SOURCES/mongodb-consistent-backup
34-
cp -f $(PWD)/conf/mongodb-consistent-backup.example.yml build/rpm/SOURCES/mongodb-consistent-backup.yml
34+
cp -f $(PWD)/conf/mongodb-consistent-backup.example.conf build/rpm/SOURCES/mongodb-consistent-backup.conf
3535
rpmbuild -D "_topdir $(PWD)/build/rpm" -D "version $(VERSION)" -bb scripts/$(NAME).spec
3636

3737
docker:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ command):
5353

5454
::
5555

56-
yum install python python-devel python-virtualenv gcc make libffi-devel openssl-devel
56+
yum install python python-devel python-virtualenv gcc git make libffi-devel openssl-devel
5757

5858
To install to default '*/usr/local/bin/mongodb-consistent-backup*\ ':
5959

mongodb_consistent_backup/Common/Config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def makeParser(self):
5858
parser.add_argument("-l", "--backup.location", dest="backup.location", help="Base path to store the backup data (required)", type=str)
5959
parser.add_argument("-m", "--backup.method", dest="backup.method", help="Method to be used for backup (default: mongodump)", default='mongodump', choices=['mongodump'])
6060
parser.add_argument("-L", "--log-dir", dest="log_dir", help="Path to write log files to (default: disabled)", default='', type=str)
61-
parser.add_argument("--lock-file", dest="lock_file", help="Location of lock file (default: /tmp/mongodb_consistent_backup.lock)", default='/tmp/mongodb_consistent_backup.lock', type=str)
61+
parser.add_argument("--lock-file", dest="lock_file", help="Location of lock file (default: /tmp/mongodb-consistent-backup.lock)", default='/tmp/mongodb-consistent-backup.lock', type=str)
6262
parser.add_argument("--sharding.balancer.wait_secs", dest="sharding.balancer.wait_secs", help="Maximum time to wait for balancer to stop, in seconds (default: 300)", default=300, type=int)
6363
parser.add_argument("--sharding.balancer.ping_secs", dest="sharding.balancer.ping_secs", help="Interval to check balancer state, in seconds (default: 3)", default=3, type=int)
6464
return self.makeParserLoadSubmodules(parser)

mongodb_consistent_backup/Main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, prog_name="mongodb-consistent-backup"):
4444
self.backup_summary = {}
4545
self.manager = Manager()
4646
self.timer = Timer(self.manager)
47-
self.timer_name = "mongodb_consistent_backup.%s" % self.__class__.__name__
47+
self.timer_name = "%s.%s" % (self.program_name, self.__class__.__name__)
4848
self.backup_time = datetime.now().strftime("%Y%m%d_%H%M")
4949
self.logger = None
5050
self.current_log_file = None

mongodb_consistent_backup/Notify/Nsca/Nsca.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def __init__(self, manager, config, timer, base_dir, backup_dir, **kwargs):
3434
self.server_name = self.server
3535
self.server_port = 5667
3636
if ':' in self.server:
37-
self.server_name, self.server_port = self.server.split(":")
37+
self.server_name, port = self.server.split(":")
38+
self.server_port = int(port)
3839
self.server = "%s:%i" % (self.server_name, self.server_port)
3940

4041
try:

mongodb_consistent_backup/Oplog/Resolver/ResolverThread.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import logging
22
import os
3-
import sys
4-
53
# Skip bson in requirements , pymongo provides
64
# noinspection PyPackageRequirements
75
from bson import decode_file_iter
@@ -25,7 +23,7 @@ def cleanup(self):
2523
if 'tailed' in self.oplogs:
2624
self.oplogs['tailed'].close()
2725
del self.oplogs['tailed']
28-
if 'file' in self.tailed_opplog and os.path.isfile(self.tailed_oplog['file']):
26+
if 'file' in self.tailed_oplog and os.path.isfile(self.tailed_oplog['file']):
2927
os.remove(self.tailed_oplog['file'])
3028

3129
def run(self):
@@ -58,7 +56,6 @@ def run(self):
5856

5957
if self.exit_code == 0:
6058
logging.info("Applied %i oplog changes to %s oplog, end ts: %s" % (self.changes, self.uri, self.mongodump_oplog_h.last_ts()))
61-
sys.exit(self.exit_code)
6259

6360
def close(self):
6461
self.cleanup()

scripts/build.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,18 @@ if [ -d ${srcdir} ]; then
9494
exit 1
9595
fi
9696

97-
# Get git HEAD of yconf
98-
if [ -d ${tmpdir}/yconf ]; then
99-
pushd ${tmpdir}/yconf
100-
git pull
101-
popd
102-
else
103-
git clone https://github.com/kampka/yconf ${tmpdir}/yconf
97+
# Get git commit 229a8280c43eaad71085361e5a5e13a20a3d37ea of yconf until 0.3.4 is released
98+
# When is 0.3.4 is released, delete this block and add 'yconf==0.3.4' to requirements.txt,
99+
# also remove yconf path from pex command at line 116.
100+
yconf_github=https://github.com/kampka/yconf
101+
yconf_commit=229a8280c43eaad71085361e5a5e13a20a3d37ea
102+
if [ ! -d ${tmpdir}/yconf ]; then
103+
git clone ${yconf_github} ${tmpdir}/yconf
104104
fi
105+
pushd ${tmpdir}/yconf
106+
git reset --hard ${yconf_commit}
107+
popd
108+
# End of yconf block
105109

106110
if [ ! -d ${pexdir} ]; then
107111
mkdir -p ${pexdir}

scripts/mongodb_consistent_backup.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Group: Software/Database
1414
License: Apache License Version 2.0
1515
URL: https://github.com/Percona-Lab/mongodb_consistent_backup
1616
Source0: %{bin_name}
17-
Source1: %{bin_name}.yml
17+
Source1: %{bin_name}.conf
1818
Source2: LICENSE
1919
Source3: README.rst
2020
Prefix: /usr

0 commit comments

Comments
 (0)