mirror of
https://github.com/ceph/s3-tests.git
synced 2025-04-23 05:49:47 +00:00
Avoid built-in "file" as variable name.
This commit is contained in:
parent
3b204bfbdc
commit
1993c33ee3
1 changed files with 4 additions and 4 deletions
|
@ -116,13 +116,13 @@ def parse_options():
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def write_file(bucket, file_name, file):
|
def write_file(bucket, file_name, fp):
|
||||||
"""
|
"""
|
||||||
Write a single file to the bucket using the file_name.
|
Write a single file to the bucket using the file_name.
|
||||||
This is used during the warmup to initialize the files.
|
This is used during the warmup to initialize the files.
|
||||||
"""
|
"""
|
||||||
key = bucket.new_key(file_name)
|
key = bucket.new_key(file_name)
|
||||||
key.set_contents_from_file(file)
|
key.set_contents_from_file(fp)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# parse options
|
# parse options
|
||||||
|
@ -166,12 +166,12 @@ def main():
|
||||||
print "Uploading initial set of {num} files".format(num=config.files.num)
|
print "Uploading initial set of {num} files".format(num=config.files.num)
|
||||||
warmup_pool = gevent.pool.Pool(size=100)
|
warmup_pool = gevent.pool.Pool(size=100)
|
||||||
for file_name in file_names:
|
for file_name in file_names:
|
||||||
file = next(files)
|
fp = next(files)
|
||||||
warmup_pool.spawn_link_exception(
|
warmup_pool.spawn_link_exception(
|
||||||
write_file,
|
write_file,
|
||||||
bucket=bucket,
|
bucket=bucket,
|
||||||
file_name=file_name,
|
file_name=file_name,
|
||||||
file=file,
|
fp=fp,
|
||||||
)
|
)
|
||||||
warmup_pool.join()
|
warmup_pool.join()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue