[FIX] package.py: search for prompt correctly.

This commit is contained in:
Christophe Simonis 2015-07-14 15:08:14 +02:00
parent e12cecea9d
commit be6c7582a0
1 changed files with 4 additions and 3 deletions

View File

@ -145,12 +145,12 @@ class OdooDocker(object):
def __init__(self):
self.log_file = NamedTemporaryFile(mode='w+b', prefix="bash", suffix=".txt", delete=False)
self.port = 8069 # TODO sle: reliable way to get a free port?
self.prompt_re = '\[root@nightly-tests\] #'
self.prompt_re = '[root@nightly-tests] # '
self.timeout = 1000
def system(self, command):
self.docker.sendline(command)
self.docker.expect(self.prompt_re)
self.docker.expect_exact(self.prompt_re)
def start(self, docker_image, build_dir, pub_dir):
self.build_dir = build_dir
@ -159,7 +159,8 @@ class OdooDocker(object):
self.docker = pexpect.spawn(
'docker run -v %s:/opt/release -p 127.0.0.1:%s:8069'
' -t -i %s /bin/bash --noediting' % (self.build_dir, self.port, docker_image),
timeout=self.timeout
timeout=self.timeout,
searchwindowsize=len(self.prompt_re) + 1,
)
time.sleep(2) # let the bash start
self.docker.logfile_read = self.log_file