Skip to content

Commit

Permalink
Use SSL with "list" and "stop" (rueckstiess#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdavis committed Sep 25, 2017
1 parent bb6ba97 commit 69a328d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mtools/mlaunch/mlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def init(self):
else:
first_init = True

self.ssl_pymongo_options = self._get_ssl_pymongo_options()
self.ssl_pymongo_options = self._get_ssl_pymongo_options(self.args)

if (self._get_ssl_server_args()
and not self.args['sslAllowConnectionsWithoutCertificates']
Expand Down Expand Up @@ -807,6 +807,9 @@ def discover(self):
if not self._load_parameters():
raise SystemExit("can't read %s/.mlaunch_startup, use 'mlaunch init ...' first." % self.dir)

self.ssl_pymongo_options = self._get_ssl_pymongo_options(
self.loaded_args)

# reset cluster_* variables
self.cluster_tree = {}
self.cluster_tags = defaultdict(list)
Expand Down Expand Up @@ -1199,12 +1202,12 @@ def _get_ssl_server_args(self):
return s


def _get_ssl_pymongo_options(self):
def _get_ssl_pymongo_options(self, args):
opts = {}
for parser in self.ssl_args, self.ssl_client_args:
for action in parser._group_actions:
name = action.dest
value = self.args.get(name)
value = args.get(name)
if value:
opts['ssl'] = True

Expand Down

0 comments on commit 69a328d

Please sign in to comment.