1
0
mirror of https://github.com/ceph/ceph synced 2025-04-01 23:02:17 +00:00

Rename osync to objsync

Rename osync to objsync to avoid confusion with O_SYNC.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
Colin Patrick McCabe 2011-03-22 04:15:22 -07:00
parent 45c6dbfe34
commit 21786afe19
2 changed files with 20 additions and 20 deletions

View File

@ -12,7 +12,7 @@
#
"""
osync.py: the object synchronizer
objsync.py: the object synchronizer
"""
from boto.s3.connection import OrdinaryCallingFormat
@ -313,23 +313,23 @@ def delete_unreferenced(src, dst):
dst.remove(dobj)
USAGE = """
osync synchronizes objects. The source and destination can both be local or
objsync synchronizes objects. The source and destination can both be local or
both remote.
Examples:
# copy contents of mybucket to disk
osync -v s3://myhost/mybucket file://mydir
objsync -v s3://myhost/mybucket file://mydir
# copy contents of mydir to an S3 bucket
osync -v file://mydir s3://myhost/mybucket
objsync -v file://mydir s3://myhost/mybucket
# synchronize two S3 buckets
SRC_AKEY=foo SRC_SKEY=foo \
DST_AKEY=foo DST_SKEY=foo \
osync -v s3://myhost/mybucket1 s3://myhost/mybucket2
objsync -v s3://myhost/mybucket1 s3://myhost/mybucket2
Note: You must specify an AWS access key and secret access key when accessing
S3. osync honors these environment variables:
S3. objsync honors these environment variables:
SRC_AKEY Access key for the source URL
SRC_SKEY Secret access key for the source URL
DST_AKEY Access key for the destination URL
@ -340,7 +340,7 @@ SKEY Secret access key for both source and dest
If these environment variables are not given, we will fall back on libboto
defaults.
osync (options) [source] [destination]"""
objsync (options) [source] [destination]"""
parser = OptionParser(USAGE)
parser.add_option("-n", "--dry-run", action="store_true", \

View File

@ -12,7 +12,7 @@
#
"""
osync_test.py: a system test for osync
objsync_test.py: a system test for objsync
"""
from optparse import OptionParser
@ -33,16 +33,16 @@ def getenv(e):
else:
return None
def osync(src, dst, misc):
full = ["./osync.py"]
def objsync(src, dst, misc):
full = ["./objsync.py"]
e = {}
if (isinstance(src, OsyncTestBucket)):
if (isinstance(src, ObjSyncTestBucket)):
full.append(src.url)
e["SRC_AKEY"] = src.akey
e["SRC_SKEY"] = src.skey
else:
full.append(src)
if (isinstance(dst, OsyncTestBucket)):
if (isinstance(dst, ObjSyncTestBucket)):
full.append(dst.url)
e["DST_AKEY"] = dst.akey
e["DST_SKEY"] = dst.skey
@ -51,10 +51,10 @@ def osync(src, dst, misc):
full.extend(misc)
return subprocess.call(full, stderr=opts.error_out, env=e)
def osync_check(src, dst, opts):
ret = osync(src, dst, opts)
def objsync_check(src, dst, opts):
ret = objsync(src, dst, opts)
if (ret != 0):
raise RuntimeError("call to osync failed!")
raise RuntimeError("call to objsync failed!")
def cleanup_tempdir():
if tdir != None and opts.keep_tempdir == False:
@ -72,8 +72,8 @@ def count_obj_in_dir(d):
num_objects = num_objects + 1
return num_objects
###### OsyncTestBucket #######
class OsyncTestBucket(object):
###### ObjSyncTestBucket #######
class ObjSyncTestBucket(object):
def __init__(self, url, akey, skey):
self.url = url
self.akey = akey
@ -108,14 +108,14 @@ if (not os.environ.has_key("URL1")):
if (opts.verbose):
print "no bucket urls were given. Running local tests only."
elif (not os.environ.has_key("URL2")):
opts.buckets.append(OsyncTestBucket(getenv("URL1"), getenv("AKEY1"),
opts.buckets.append(ObjSyncTestBucket(getenv("URL1"), getenv("AKEY1"),
getenv("SKEY1")))
if (opts.verbose):
print "have scratch1_url: will test bucket transfers"
else:
opts.buckets.append(OsyncTestBucket(getenv("URL1"), getenv("AKEY1"),
opts.buckets.append(ObjSyncTestBucket(getenv("URL1"), getenv("AKEY1"),
getenv("SKEY1")))
opts.buckets.append(OsyncTestBucket(getenv("URL2"), getenv("AKEY2"),
opts.buckets.append(ObjSyncTestBucket(getenv("URL2"), getenv("AKEY2"),
getenv("SKEY2")))
if (opts.verbose):
print "have both scratch1_url and scratch2_url: will test \