fix pushkit bug

Signed-off-by: deveco_test <liguangjie1@huawei.com>
This commit is contained in:
deveco_test
2022-08-23 16:06:32 +08:00
parent a134f62a87
commit c8457e193a
2 changed files with 10 additions and 5 deletions
@@ -315,6 +315,8 @@ class Device(IDevice):
The top directory won't be created if is_create is False (by default)
and vice versa
"""
local = "\"{}\"".format(local)
remote = "\"{}\"".format(remote)
if local is None:
raise HdcError("XDevice Local path cannot be None!")
@@ -343,6 +345,8 @@ class Device(IDevice):
The top directory won't be created if is_create is False (by default)
and vice versa
"""
local = "\"{}\"".format(local)
remote = "\"{}\"".format(remote)
if self.host != "127.0.0.1":
self.connector_command("file recv {} {}".format(remote, local))
else:
+6 -5
View File
@@ -249,16 +249,17 @@ class PushKit(ITestKit):
device.connector_command("shell mkdir {}".format(dst))
for root, _, files in os.walk(real_src_path):
for file in files:
device.connector_command(
"file send \"{}\" \"{}\"".format(os.path.join(root, file),
dst))
device.push_file("{}".format(os.path.join(root, file)),
"{}".format(dst))
LOG.debug(
"Push file finished from {} to {}".format(
os.path.join(root, file), dst))
self.pushed_file.append(os.path.join(dst, file))
else:
device.connector_command("file send \"{}\" \"{}\"".format(real_src_path,
dst))
if device.is_directory(dst):
dst = os.path.join(dst, os.path.basename(real_src_path))
device.push_file("{}".format(real_src_path),
"{}".format(dst))
LOG.debug("Push file finished from {} to {}".format(src, dst))
self.pushed_file.append(dst)
for command in self.post_push: