summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-03-20 00:04:01 +0000
committerGerrit Code Review <review@openstack.org>2018-03-20 00:04:01 +0000
commitb20893f540b3b06a950386bdfd94a0457cc1ca1b (patch)
tree1e86df3ce9babf8346c7099d28a4a9f4ec63169e /bin
parentf2e8565bb63e740f386248a05e9e90c83a0827eb (diff)
parentb08c70d38e1d49b73c241b227e4fcc62fe164a04 (diff)
downloadswift-b20893f540b3b06a950386bdfd94a0457cc1ca1b.tar.gz
Merge "Support -d <devs> and -p <partitions> in DB replicators."
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift-account-replicator13
-rwxr-xr-xbin/swift-container-replicator13
2 files changed, 24 insertions, 2 deletions
diff --git a/bin/swift-account-replicator b/bin/swift-account-replicator
index fec6d49ef..072b6e031 100755
--- a/bin/swift-account-replicator
+++ b/bin/swift-account-replicator
@@ -14,10 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import optparse
+
from swift.account.replicator import AccountReplicator
from swift.common.utils import parse_options
from swift.common.daemon import run_daemon
if __name__ == '__main__':
- conf_file, options = parse_options(once=True)
+ parser = optparse.OptionParser("%prog CONFIG [options]")
+ parser.add_option('-d', '--devices',
+ help=('Replicate only given devices. '
+ 'Comma-separated list. '
+ 'Only has effect if --once is used.'))
+ parser.add_option('-p', '--partitions',
+ help=('Replicate only given partitions. '
+ 'Comma-separated list. '
+ 'Only has effect if --once is used.'))
+ conf_file, options = parse_options(parser=parser, once=True)
run_daemon(AccountReplicator, conf_file, **options)
diff --git a/bin/swift-container-replicator b/bin/swift-container-replicator
index b3b235ef9..d1990216c 100755
--- a/bin/swift-container-replicator
+++ b/bin/swift-container-replicator
@@ -14,10 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import optparse
+
from swift.container.replicator import ContainerReplicator
from swift.common.utils import parse_options
from swift.common.daemon import run_daemon
if __name__ == '__main__':
- conf_file, options = parse_options(once=True)
+ parser = optparse.OptionParser("%prog CONFIG [options]")
+ parser.add_option('-d', '--devices',
+ help=('Replicate only given devices. '
+ 'Comma-separated list. '
+ 'Only has effect if --once is used.'))
+ parser.add_option('-p', '--partitions',
+ help=('Replicate only given partitions. '
+ 'Comma-separated list. '
+ 'Only has effect if --once is used.'))
+ conf_file, options = parse_options(parser=parser, once=True)
run_daemon(ContainerReplicator, conf_file, **options)