Skip to content

Commit cfd4ed4

Browse files
author
Tim Vaillancourt
committed
only validate the chosen config-server hostname
1 parent 5e3cdc5 commit cfd4ed4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

MongoBackup/Sharding.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ def get_configdb_hosts(self):
114114
try:
115115
if "/" in config_string:
116116
config_replset, config_string = config_string.split("/")
117-
config_hosts = config_string.split(',')
118-
for config_host in config_hosts:
119-
validate_hostname(hostname)
120-
return config_hosts
117+
return config_string.split(',')
121118
except Exception:
122119
validate_hostname(config_string)
123120
return [config_string]
@@ -132,6 +129,7 @@ def get_config_server(self, force=False):
132129
configdb_hosts = self.get_configdb_hosts()
133130
try:
134131
config_host, config_port = configdb_hosts[0].split(":")
132+
validate_hostname(config_host)
135133
logging.info("Found sharding config server: %s:%s" % (config_host, config_port))
136134

137135
self.config_db = DB(config_host, config_port, self.user, self.password, self.authdb)

0 commit comments

Comments
 (0)