blob: 0245e3db0726064e9d529d7fe0f7ac76a759e6a8 [file] [log] [blame] [edit]
#!/usr/bin/python2
#
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from contextlib import closing
from autotest_lib.client.common_lib import error
from autotest_lib.client.common_lib.cros import dev_server
from autotest_lib.server import hosts
# Url to server-side package staged on devserver.
ssp_url = None
# Error message raised by stage_server_side_package call.
error_msg = None
# Only need to stage server side package once.
for machine in machines:
try:
with closing(hosts.create_host(machine)) as host:
ssp_url = host.stage_server_side_package(image)
break
except (error.AutoservError, dev_server.DevServerException) as e:
error_msg = str(e)
logging.error('Stage server-side package failed. %s', e)