Fix SSL certificate removal with WordOps backend

This commit is contained in:
VirtuBox
2019-08-29 16:43:25 +02:00
parent b5cdd172ef
commit 9b7291d04f
4 changed files with 36 additions and 10 deletions

View File

@@ -244,6 +244,22 @@ class WOFileUtils():
Log.error(self, "Unable to Search string {0} in {1}"
.format(sstr, fnm))
def grepcheck(self, fnm, sstr):
"""
Searches for string in file and returns True or False.
"""
try:
Log.debug(self, "Finding string {0} to file {1}"
.format(sstr, fnm))
for line in open(fnm, encoding='utf-8'):
if sstr in line:
return True
return False
except OSError as e:
Log.debug(self, "{0}".format(e.strerror))
Log.error(self, "Unable to Search string {0} in {1}"
.format(sstr, fnm))
def rm(self, path):
"""
Remove files