ivandasch commented on a change in pull request #8686:
URL: https://github.com/apache/ignite/pull/8686#discussion_r579312412



##########
File path: modules/ducktests/tests/ignitetest/services/utils/control_utility.py
##########
@@ -376,6 +366,41 @@ def __parse_output(raw_output):
     def __alives(self):
         return [node for node in self._cluster.nodes if 
self._cluster.alive(node)]
 
+    def _parse_ssl_params(self, user, globals_dict, **kwargs):
+        ssl_dict = None
+        if globals_dict.get('use_ssl'):
+            if user in globals_dict and 'ssl' in globals_dict[user]:
+                ssl_dict = globals_dict[user]['ssl']
+            else:
+                ssl_dict = {}
+        elif kwargs.get('key_store_jks') or kwargs.get('key_store_path'):
+            ssl_dict = kwargs
+        return None if ssl_dict is None else \
+            
SslContextFactory(key_store_path=self.__get_store_path('key_store', ssl_dict),
+                              
key_store_password=ssl_dict.get('key_store_password', DEFAULT_PASSWORD),
+                              
trust_store_path=self.__get_store_path('trust_store', ssl_dict),
+                              
trust_store_password=ssl_dict.get('trust_store_password', DEFAULT_PASSWORD))
+
+    def __get_store_path(self, store_type, ssl_dict):
+        path_key = f'{store_type}_path'
+        store_name = f'{store_type}_jks'
+        default_name = DEFAULT_TRUSTSTORE if store_type == 'trust_store' else 
DEFAULT_ADMIN_KEYSTORE
+        return ssl_dict.get(path_key, self.jks_path(ssl_dict.get(store_name, 
default_name)))
+
+    @staticmethod
+    def _parse_creds(user, globals_dict, **kwargs):
+        creds_dict = None
+        if globals_dict.get('use_auth'):
+            if user in globals_dict and 'creds' in globals_dict[user]:
+                creds_dict = globals_dict[user]['creds']
+            else:
+                creds_dict = {}
+        elif kwargs.get('login'):
+            creds_dict = kwargs
+        return None if creds_dict is None else \
+            (creds_dict.get("login", DEFAULT_AUTH_LOGIN),

Review comment:
       Its more convenient to return None, None, and you should not user braces 
here
   
   Could you explain what the purpose of this function? When you use 'login' as 
arg?
   Why you use kwargs var, if you use only one named variable?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to