Bug 704618 - Allow directory as a destination argument to SUT pushFile(); r=jmaher

This commit is contained in:
Geoff Brown 2011-11-30 13:19:49 +00:00
parent b6cdc0ee29
commit 204a097bd9

View File

@ -266,6 +266,10 @@ class DeviceManagerSUT(DeviceManager):
destname = destname.replace('\\', '/')
if (self.debug >= 3): print "in push file with: " + localname + ", and: " + destname
if (self.dirExists(destname)):
if (not destname.endswith('/')):
destname = destname + '/'
destname = destname + os.path.basename(localname)
if (self.validateFile(destname, localname) == True):
if (self.debug >= 3): print "files are validated"
return True
@ -352,7 +356,10 @@ class DeviceManagerSUT(DeviceManager):
parts = root.split(localDir)
for file in files:
remoteRoot = remoteDir + '/' + parts[1]
remoteName = remoteRoot + '/' + file
if (remoteRoot.endswith('/')):
remoteName = remoteRoot + file
else:
remoteName = remoteRoot + '/' + file
if (parts[1] == ""): remoteRoot = remoteDir
if (self.pushFile(os.path.join(root, file), remoteName) == False):
# retry once