Skip to content

Commit

Permalink
MB-15991: Use right endpoint for view index
Browse files Browse the repository at this point in the history
Change-Id: I32f99f7f066c71fc38721b3521cca8e01dea73f5
Reviewed-on: http://review.couchbase.org/54226
Reviewed-by: Bin Cui <bin.cui@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
  • Loading branch information
Bin Cui authored and bcui6611 committed Aug 7, 2015
1 parent 0843183 commit 5b14ead
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pump_cb.py
Expand Up @@ -158,7 +158,6 @@ def consume_index(opts, sink_spec, sink_map,
sd = json.loads(source_design)
if not sd:
return 0
print json.dumps(sd, indent=2)
except ValueError, e:
return "error: could not parse source design; exception: %s" % (e)

Expand All @@ -174,15 +173,14 @@ def consume_index(opts, sink_spec, sink_map,
host,port = pump.hostport(index_server)
sink_bucket = sink_map['buckets'][0]
url = "/restoreIndexMetadata?bucket=%s" % sink_bucket['name']
#post_headers = {"Content-type": "application/x-www-form-urlencoded"}
err, conn, response = \
pump.rest_request(host, couchbaseConstants.INDEX_PORT, user, pswd, opts.ssl,
url, method='POST',
#body=urllib.urlencode(sd),
body=json.dumps(sd),
#headers=post_headers,
reason='restore index')
print response
logging.debug(response)
return 0

@staticmethod
Expand Down Expand Up @@ -289,7 +287,7 @@ def consume_design(opts, sink_spec, sink_map,
try:
err, conn, response = \
pump.rest_request(host, int(port), user, pswd, opts.ssl,
"/query/service", method='PUT', body=js_doc,
path + "/" + id, method='PUT', body=js_doc,
reason="consume_design")
if conn:
conn.close()
Expand Down

0 comments on commit 5b14ead

Please sign in to comment.