Skip to content

Commit 60bb62a

Browse files
committed
Only do pull replication, push will be possible by reversing arguments.
1 parent 8033f6b commit 60bb62a

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

couchdb/tools/replicate.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
'--continuous' option to set up automatic replication on newer
1515
CouchDB versions.
1616
17-
Use 'python replicate.py --help' to get more detailed usage
18-
instructions.
19-
20-
Be careful when using 127.0.0.1 as the source-server or target-server.
21-
With pull replication you can use 127.0.0.1 on the target-server.
22-
With push replication you can use 127.0.0.1 on the source-server.
23-
But I suggest you always use Fully Qualified domain names.
17+
Use 'python replicate.py --help' to get more detailed usage instructions.
2418
"""
2519

2620
import couchdb.client
@@ -59,12 +53,8 @@ def main():
5953
action='store_true',
6054
dest='continuous',
6155
help='trigger continuous replication in cochdb')
62-
parser.add_option('--push',
63-
action='store_true',
64-
help='use push instead of pull replication')
6556

6657
options, args = parser.parse_args()
67-
6858
if not options.target_url or (not options.source_url):
6959
parser.error("Need at least --source-server and --target-server")
7060
sys.exit(1)
@@ -97,14 +87,8 @@ def main():
9787
if options.continuous:
9888
body['continuous'] = True
9989

100-
if options.push:
101-
body.update({'source': dbname, 'target': '%s%s' % (options.target_url, dbname)})
102-
source_server.resource.post('_replicate', body)
103-
else:
104-
# pull seems to be more reliable than push
105-
body.update({'source': '%s%s' % (options.source_url, dbname), 'target': dbname})
106-
target_server.resource.post('_replicate', body)
107-
90+
body.update({'source': '%s%s' % (options.source_url, dbname), 'target': dbname})
91+
target_server.resource.post('_replicate', body)
10892
print '%.1fs' % (time.time() - start)
10993

11094
if options.compact_target:

0 commit comments

Comments
 (0)