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

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

Issue 3433001: Fix factory test (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: 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
« no previous file with comments | « client/common_lib/gbb_util.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ftp.storbinary('STOR %s' % dest['filename'], fileobj) 57 ftp.storbinary('STOR %s' % dest['filename'], fileobj)
58 ftp.quit() 58 ftp.quit()
59 59
60 def run_once(self, destination): 60 def run_once(self, destination):
61 assert 'filename' not in destination, "file names must be generated" 61 assert 'filename' not in destination, "file names must be generated"
62 if destination['host'] == '*': 62 if destination['host'] == '*':
63 factory.log('WARNING: FACTORY LOG UPLOADING IS BYPASSED.') 63 factory.log('WARNING: FACTORY LOG UPLOADING IS BYPASSED.')
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(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/common_lib/gbb_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698