From: Colin Patrick McCabe Date: Thu, 5 May 2011 17:18:47 +0000 (-0700) Subject: obsync: implement --force option X-Git-Tag: v0.28~88 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8964359c9d0a56e72b64c81a2ceda1ec3c29c5be;p=ceph.git obsync: implement --force option Signed-off-by: Colin McCabe --- diff --git a/src/obsync/obsync.py b/src/obsync/obsync.py index 10189f1268df..2ebd3e6e8c92 100755 --- a/src/obsync/obsync.py +++ b/src/obsync/obsync.py @@ -896,6 +896,9 @@ parser.add_option("-V", "--more-verbose", action="store_true", \ parser.add_option("-x", "--xuser", type="string", nargs=1, action="callback", \ dest="SRC=DST", callback=xuser_cb, help="set up a user tranlation. You \ can specify multiple user translations with multiple --xuser arguments.") +parser.add_option("--force", action="store_true", \ + dest="force", help="overwrite all destination objects, even if they \ +appear to be the same as the source objects.") parser.add_option("--unit", action="store_true", \ dest="run_unit_tests", help="run unit tests and quit") xuser = {} @@ -967,7 +970,11 @@ for sobj in src.all_objects(): upload = False src_acl = None dst_acl = None - if (dobj == None): + if (opts.force): + if (opts.verbose): + print "F " + sobj.name + upload = True + elif (dobj == None): if (opts.verbose): print "+ " + sobj.name upload = True