Skip to content

Commit 760c457

Browse files
authored
Merge pull request #72 from timvaillancourt/no_csserver_port_fix
Assume port 27019 if there is no :PORT in configdb hosts
2 parents 26a1800 + 3940dab commit 760c457

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

MongoBackup/Methods/Dumper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ def run(self):
9595
# backup a single non-replset config server, if exists:
9696
if not self.config_replset and isinstance(self.config_server, dict):
9797
logging.info("Using non-replset backup method for config server mongodump")
98+
config_server = self.config_server['host']
99+
if not ":" in config_server:
100+
config_server = config_server+":27019"
98101
self.threads = [Dump(
99102
self.response_queue,
100103
'configsvr',
101-
self.config_server['host'],
104+
config_server,
102105
self.user,
103106
self.password,
104107
self.authdb,

MongoBackup/Sharding.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ def get_config_server(self, force=False):
127127
if force or not self.config_server:
128128
configdb_hosts = self.get_configdb_hosts()
129129
try:
130-
config_host, config_port = configdb_hosts[0].split(":")
130+
config_host = configdb_hosts[0]
131+
config_port = 27019
132+
if ":" in configdb_hosts[0]:
133+
config_host, config_port = configdb_hosts[0].split(":")
131134
validate_hostname(config_host)
132135
logging.info("Found sharding config server: %s:%s" % (config_host, config_port))
133136

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.4
1+
0.3.5

0 commit comments

Comments
 (0)