diff --git a/src/osync/osync.py b/src/objsync/objsync.py similarity index 97% rename from src/osync/osync.py rename to src/objsync/objsync.py index bfc23969009..7347c29652e 100755 --- a/src/osync/osync.py +++ b/src/objsync/objsync.py @@ -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", \ diff --git a/src/osync/osync-test.py b/src/objsync/test-objsync.py similarity index 93% rename from src/osync/osync-test.py rename to src/objsync/test-objsync.py index c30734ab2cb..6b990a726c0 100755 --- a/src/osync/osync-test.py +++ b/src/objsync/test-objsync.py @@ -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 \