summaryrefslogtreecommitdiffstats
path: root/dovetail/container.py
diff options
context:
space:
mode:
Diffstat (limited to 'dovetail/container.py')
-rw-r--r--dovetail/container.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/dovetail/container.py b/dovetail/container.py
index 71fa346f..583f2e0c 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -66,8 +66,7 @@ class Container(object):
ins_type = " -e INSTALLER_TYPE=vendor-specific"
scenario = " -e DEPLOY_SCENARIO=default"
node = " -e NODE_NAME=master"
- tag = " -e BUILD_TAG=daily-master-001"
- envs = "%s %s %s %s" % (ins_type, scenario, node, tag)
+ envs = "%s %s %s" % (ins_type, scenario, node)
dovetail_config = dt_cfg.dovetail_config
if dovetail_config['report_dest'].startswith("http"):
@@ -111,8 +110,10 @@ class Container(object):
if not openrc:
return None
- # This is used for showing the debug logs of the upstream projects
+ # CI_DEBUG is used for showing the debug logs of the upstream projects
+ # BUILD_TAG is the unique id for this test
envs = ' -e CI_DEBUG=true'
+ envs = envs + ' -e BUILD_TAG=%s' % dovetail_config['build_tag']
config = ""
if type.lower() == "functest":
@@ -214,3 +215,11 @@ class Container(object):
return (1, 'sub_cmd is empty')
cmd = 'sudo docker exec %s /bin/bash -c "%s"' % (container_id, sub_cmd)
return dt_utils.exec_cmd(cmd, cls.logger, exit_on_error)
+
+ @classmethod
+ def pre_copy(cls, container_id, src_path, dest_path, exit_on_error=False):
+ if src_path == "" or dest_path == "":
+ return (1, 'src_path or dest_path is empty')
+ cmd = 'sudo docker cp %s %s:%s' % (src_path, container_id, dest_path)
+ cls.logger.debug('execute cmd %s', cmd)
+ return dt_utils.exec_cmd(cmd, cls.logger, exit_on_error)