Allow overriding is_newer_tomcat_version()

This is needed so we can mock the DogtagInstance class
and have control over the version of tomcat.

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Rob Crittenden 2021-02-01 19:54:10 -05:00 committed by Florence Blanc-Renaud
parent 8a715feb57
commit fd66a74a59

View File

@ -294,7 +294,7 @@ class DogtagInstance(service.Service):
logger.critical("failed to uninstall %s instance %s",
self.subsystem, e)
def __is_newer_tomcat_version(self, default=None):
def _is_newer_tomcat_version(self, default=None):
try:
result = ipautil.run([paths.BIN_TOMCAT, "version"],
capture_output=True)
@ -335,7 +335,7 @@ class DogtagInstance(service.Service):
# 9.0.31.0 or later uses 'secret'
secretattr = 'requiredSecret'
oldattr = 'requiredSecret'
if self.__is_newer_tomcat_version('9.0.31.0'):
if self._is_newer_tomcat_version('9.0.31.0'):
secretattr = 'secret'
# AJP protocol is at version 1.3. With IPv4/IPv6 split, there might