Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: client/site_tests/factory_UploadLogs/factory_UploadLogs.py

Issue 3438007: Replace newline characters in factory tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Address review comments Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import ftplib 5 import ftplib
6 import gzip 6 import gzip
7 import hashlib 7 import hashlib
8 import os 8 import os
9 import StringIO 9 import StringIO
10 10
11 from autotest_lib.client.bin import factory 11 from autotest_lib.client.bin import factory
12 from autotest_lib.client.bin import test, utils 12 from autotest_lib.client.bin import test, utils
13 from autotest_lib.client.common_lib import error 13 from autotest_lib.client.bin import factory_error as error
14 14
15 class factory_UploadLogs(test.test): 15 class factory_UploadLogs(test.test):
16 version = 1 16 version = 1
17 17
18 DEFAULT_DESTINATION_PARAM = { 18 DEFAULT_DESTINATION_PARAM = {
19 'method': 'ftp', 19 'method': 'ftp',
20 'host': 'localhost', 20 'host': 'localhost',
21 'port': ftplib.FTP.port, 21 'port': ftplib.FTP.port,
22 'user': 'anonymous', 22 'user': 'anonymous',
23 'passwd': '', 23 'passwd': '',
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return 64 return
65 src_hash, src_obj = self.prepare_source_object(factory.LOG_PATH) 65 src_hash, src_obj = self.prepare_source_object(factory.LOG_PATH)
66 dest = {} 66 dest = {}
67 dest.update(self.DEFAULT_DESTINATION_PARAM) 67 dest.update(self.DEFAULT_DESTINATION_PARAM)
68 dest.update(destination) 68 dest.update(destination)
69 dest_name = src_hash + '.log' 69 dest_name = src_hash + '.log'
70 if self.USE_GZIP: 70 if self.USE_GZIP:
71 dest_name = dest_name + '.gz' 71 dest_name = dest_name + '.gz'
72 dest['filename'] = os.path.join(dest['initdir'], dest_name) 72 dest['filename'] = os.path.join(dest['initdir'], dest_name)
73 self.do_upload_file(dest, src_obj) 73 self.do_upload_file(dest, src_obj)
OLDNEW
« no previous file with comments | « client/site_tests/factory_Touchpad/factory_Touchpad.py ('k') | client/site_tests/factory_Verify/factory_Verify.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698