Bugfix: copy plugin assumed always that all commands like cp, copy, xcopy are

shell command. In fact copy and xcopy are shell commands under Windows and 'cp'
is always a separate app. not shell command e.g. in Windows.
pull/1094/head
Przemek Wirkus 2015-05-06 16:31:55 +01:00
parent abee10eee8
commit 65bae00f61
2 changed files with 4 additions and 2 deletions

View File

@ -106,6 +106,7 @@ class HostTestPluginBase:
""" Runs command from command line.
"""
result = True
ret = 0
try:
ret = call(cmd, shell=shell)
if ret:

View File

@ -51,10 +51,11 @@ class HostTestPluginCopyMethod_Shell(HostTestPluginBase):
if capabilitity == 'shell':
if os.name == 'nt': capabilitity = 'copy'
elif os.name == 'posix': capabilitity = 'cp'
if capabilitity == 'cp' or capabilitity == 'copy' or capabilitity == 'copy':
if capabilitity == 'cp' or capabilitity == 'copy' or capabilitity == 'xcopy':
copy_method = capabilitity
cmd = [copy_method, image_path, destination_path]
result = self.run_command(cmd)
shell = not capabilitity == 'cp'
result = self.run_command(cmd, shell=shell)
return result