blob: aaae72a0f76820d9035e481208dc83bcc45f748b [file] [log] [blame]
Mariusz Wagnercfd26b92018-06-13 14:30:27 +02001import docker
2
3class PrhLibrary(object):
Mariusz Wagner60be36d2018-07-05 11:32:51 +02004
Mariusz Wagnercfd26b92018-06-13 14:30:27 +02005 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