=== modified file 'lava_dispatcher/actions/launch_control.py'
@@ -20,18 +20,19 @@
# along
# with this program; if not, see <http://www.gnu.org/licenses>.
+import json
import os
-import json
+import pexpect
import shutil
import tarfile
from lava_dispatcher.actions import BaseAction
-from lava_dispatcher.config import LAVA_RESULT_DIR, MASTER_STR, LAVA_SERVER_IP
+from lava_dispatcher.config import LAVA_RESULT_DIR, MASTER_STR
from lava_dispatcher.config import LAVA_IMAGE_TMPDIR
from lava_dispatcher.client import NetworkError
from lava_dispatcher.utils import download
+from tempfile import mkdtemp
import time
import xmlrpclib
-from subprocess import call
class cmd_submit_results_on_host(BaseAction):
def run(self, server, stream):
@@ -43,7 +44,7 @@
bundle_list = os.listdir("/tmp/%s" % LAVA_RESULT_DIR)
for bundle_name in bundle_list:
bundle = "/tmp/%s/%s" % (LAVA_RESULT_DIR, bundle_name)
- f = open(bundle)
+ f = open(bundle)
content = f.read()
f.close()
try:
@@ -106,7 +107,7 @@
os.chmod(tarball_dir, 0755)
#FIXME: need to consider exception?
result_path = download(result_tarball, tarball_dir)
- id = client.proc.expect([MASTER_STR, pexpect.TIMEOUT, pexpect.EOF],
+ id = client.proc.expect([MASTER_STR, pexpect.TIMEOUT, pexpect.EOF],
timeout=3)
client.run_shell_command('kill %1', response=MASTER_STR)
@@ -119,7 +120,7 @@
self.all_bundles.append(json.loads(content))
tar.close()
shutil.rmtree(tarball_dir)
-
+
#flush the serial log
client.run_shell_command("")
=== modified file 'lava_dispatcher/client.py'
@@ -128,6 +128,7 @@
def get_master_ip(self):
#get master image ip address
+ self.wait_network_up()
#tty device uses minimal match, see pexpect wiki
#pattern1 = ".*\n(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
pattern1 = "(\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?\.\d?\d?\d?)"
@@ -136,7 +137,7 @@
self.proc.sendline(cmd)
#if running from ipython, it needs another Enter, don't know why
#self.proc.sendline("")
- id = self.proc.expect([pattern1, pexpect.EOF,
+ id = self.proc.expect([pattern1, pexpect.EOF,
pexpect.TIMEOUT], timeout=5)
print "\nid=%s" %id
if id == 0: