summaryrefslogtreecommitdiffstats
path: root/dovetail/container.py
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2017-03-22 02:39:25 -0400
committerJun Li <matthew.lijun@huawei.com>2017-03-30 07:25:47 +0000
commitd2a04a76f9f03ca4c34cfed335c14d7c3319c634 (patch)
tree236429b66a2e41f922f5da3e645c44221ea06c51 /dovetail/container.py
parente0f4b3a6f279e8e3f4bc05307d60d6983cc60735 (diff)
dovetail tool: refstack testcase integration
JIRA: DOVETAIL-370 Change-Id: I60c9f431358f848e24abcb865c4b2ca8c3b2d843 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
Diffstat (limited to 'dovetail/container.py')
-rw-r--r--dovetail/container.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/dovetail/container.py b/dovetail/container.py
index 878b21cb..9f4edd40 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -205,3 +205,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)