Skip to content

Commit 5e15ae7

Browse files
Make shared func for parsing config bools #2
1 parent 4e9d07a commit 5e15ae7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

mongodb_consistent_backup/Backup/Mongodump/MongodumpThread.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ def __init__(self, state, uri, timer, config, base_dir, version, threads=0, dump
2828
self.user = self.config.username
2929
self.password = self.config.password
3030
self.authdb = self.config.authdb
31-
self.ssl_enabled = self.config.ssl.enabled
32-
self.ssl_insecure = self.config.ssl.insecure
3331
self.ssl_ca_file = self.config.ssl.ca_file
3432
self.ssl_crl_file = self.config.ssl.crl_file
3533
self.ssl_client_cert_file = self.config.ssl.client_cert_file
@@ -58,10 +56,10 @@ def close(self, exit_code=None, frame=None):
5856
sys.exit(self.exit_code)
5957

6058
def do_ssl(self):
61-
return parse_config_bool(self.ssl_enabled)
59+
return parse_config_bool(self.config.ssl.enabled)
6260

6361
def do_ssl_insecure(self):
64-
return parse_config_bool(self.ssl_insecure)
62+
return parse_config_bool(self.config.ssl.insecure)
6563

6664
def parse_mongodump_line(self, line):
6765
try:

mongodb_consistent_backup/Common/DB.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def __init__(self, uri, config, do_replset=False, read_pref='primaryPreferred',
2424
self.username = self.config.username
2525
self.password = self.config.password
2626
self.authdb = self.config.authdb
27-
self.ssl_enabled = self.config.ssl.enabled
28-
self.ssl_insecure = self.config.ssl.insecure
2927
self.ssl_ca_file = self.config.ssl.ca_file
3028
self.ssl_crl_file = self.config.ssl.crl_file
3129
self.ssl_client_cert_file = self.config.ssl.client_cert_file
@@ -38,10 +36,10 @@ def __init__(self, uri, config, do_replset=False, read_pref='primaryPreferred',
3836
self.auth_if_required()
3937

4038
def do_ssl(self):
41-
return parse_config_bool(self.ssl_enabled)
39+
return parse_config_bool(self.config.ssl.enabled)
4240

4341
def do_ssl_insecure(self):
44-
return parse_config_bool(self.ssl_insecure)
42+
return parse_config_bool(self.config.ssl.insecure)
4543

4644
def client_opts(self):
4745
opts = {

0 commit comments

Comments
 (0)