Permalink
Browse files

pulling ddocs URL from bucket info endpoint

Looking up the URL vs. constructing it.

Change-Id: I5ad7b1ce2048543f48653ba32fc30237ac3cb78d
Reviewed-on: http://review.couchbase.org/20403
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: Benjamin Young <benjamin@couchbase.com>
  • Loading branch information...
1 parent 96da422 commit 4c13e88c6c2eab8ff7d843a231a76ea54f36d752 @BigBlueHat BigBlueHat committed with Benjamin Young Aug 31, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −2 couchbase/client.py
  2. +1 −0 couchbase/rest_client.py
View
@@ -338,8 +338,8 @@ def view(self, view, **options):
def design_docs(self):
"""List all design documents and return DesignDoc objects for each"""
(ip, port, _, _) = self.server._rest_info()
- api = ''.join(['http://{0}:{1}/pools/default/buckets/{2}/ddocs' \
- .format(ip, port, self.name)])
+ api = ''.join(['http://{0}:{1}'.format(ip, port),
+ self.info.ddocs['uri']])
r = requests.get(api, auth=(self.server.rest_username,
self.server.rest_password))
ddocs = []
View
@@ -1052,6 +1052,7 @@ def parse_get_bucket_json(self, parsed):
bucket.authType = parsed["authType"]
bucket.saslPassword = parsed["saslPassword"]
bucket.controllers = parsed['controllers']
+ bucket.ddocs = parsed['ddocs']
bucket.nodes = list()
if 'vBucketServerMap' in parsed:
vBucketServerMap = parsed['vBucketServerMap']

0 comments on commit 4c13e88

Please sign in to comment.