blob: f07f385f572f156194d20fa86218caaa5faa8a77 [file] [log] [blame]
Mariusz Wagnercfd26b92018-06-13 14:30:27 +02001import docker
2
3class PrhLibrary(object):
4
5 def __init__(self):
6 pass
7
Mariusz Wagnera2a6c982018-06-14 15:53:56 +02008 def check_for_log(self, search_for):
Mariusz Wagnercfd26b92018-06-13 14:30:27 +02009 client = docker.from_env()
10 container = client.containers.get('prh')
11 for line in container.logs(stream=True):
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020012 if search_for in line.strip():
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020013 return True
14 else:
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020015 return False
16