andreaspeters commented on a change in pull request #383:
URL: https://github.com/apache/mesos/pull/383#discussion_r642617105
##########
File path: src/python/cli_new/lib/cli/config.py
##########
@@ -119,6 +120,92 @@ def master(self):
return master
+ def principal(self):
+ """
+ Return the principal in the configuration file
+ """
+ return self.data["master"].get("principal")
+
+ def secret(self):
+ """
+ Return the secret in the configuration file
+ """
+ return self.data["master"].get("secret")
+
+ def agent_ssl(self):
+ """
+ Return if the agent support ssl
+ """
+ if "agent" in self.data:
+ agent_ssl = self.data["agent"].get("ssl")
+ if agent_ssl is None:
+ return None
+ if not isinstance(agent_ssl, bool):
+ raise CLIException("The 'agent->ssl' field"
+ " must be True/False")
+
+ return agent_ssl
+
+ return None
+
+ def agent_ssl_verify(self):
+ """
+ Return if the ssl certificate should be verified
+ """
+ if "agent" in self.data:
+ ssl_verify = self.data["agent"].get("ssl_verify")
+ if ssl_verify is None:
+ return None
+ if not isinstance(ssl_verify, bool):
+ raise CLIException("The 'agent->ssl_verify' field"
+ " must be True/False")
+
+ return ssl_verify
+
+ return None
+
+ def agent_timeout(self):
+ """
+ Return the connection timeout of the agent
+ """
+ if "agent" in self.data:
+ timeout = self.data["agent"].get("timeout")
+ if timeout is None:
+ return 5
+ if not isinstance(timeout, int):
+ raise CLIException("The 'agent->timeout' field"
+ " must be a number in seconds")
+
+ return timeout
+
+ return 5
+
+ def agent_principal(self):
+ """
+ Return the principal in the configuration file
+ """
+ if "agent" in self.data:
+ principal = self.data["agent"].get("principal")
+ if principal is None:
+ return None
+
+ return principal
Review comment:
:joy: I was not so brave. But of course, u are right.
--
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:
[email protected]