Skip to content

Commit

Permalink
fix all places where .json is used instead of .json()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Vogt committed Dec 18, 2012
1 parent 3c694c3 commit f0d0238
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion couchbase/client.py
Expand Up @@ -343,7 +343,7 @@ def design_docs(self):
r = requests.get(api, auth=(self.server.rest_username, r = requests.get(api, auth=(self.server.rest_username,
self.server.rest_password)) self.server.rest_password))
ddocs = [] ddocs = []
for ddoc in r.json.get('rows'): for ddoc in r.json().get('rows'):
ddocs.append(DesignDoc(ddoc['doc']['meta']['id'], ddocs.append(DesignDoc(ddoc['doc']['meta']['id'],
ddoc['doc']['json'], bucket=self)) ddoc['doc']['json'], bucket=self))


Expand Down
16 changes: 8 additions & 8 deletions couchbase/rest_client.py
Expand Up @@ -174,7 +174,7 @@ def __init__(self, serverInfo):


self.base_url = "http://{0}:{1}".format(self.ip, self.port) self.base_url = "http://{0}:{1}".format(self.ip, self.port)
server_config_uri = ''.join([self.base_url, '/pools/default']) server_config_uri = ''.join([self.base_url, '/pools/default'])
self.config = requests.get(server_config_uri).json self.config = requests.get(server_config_uri).json()
# if couchApiBase is not set earlier, let's look it up # if couchApiBase is not set earlier, let's look it up
if self.couch_api_base is None: if self.couch_api_base is None:
#couchApiBase is not in node config before Couchbase Server 2.0 #couchApiBase is not in node config before Couchbase Server 2.0
Expand Down Expand Up @@ -307,15 +307,15 @@ def _http_request(self, api, method='GET', params=None, headers=None,
else: else:
reason = "unknown" reason = "unknown"
status = False status = False
if r.json is None: if r.json() is None:
reason = r.text reason = r.text
status = False status = False
elif "error" in r.json: elif "error" in r.json():
reason = r.json["error"] reason = r.json()["error"]
status = False status = False
elif "errors" in r.json: elif "errors" in r.json():
errors = [error for _, error in errors = [error for _, error in
r.json["errors"].iteritems()] r.json()["errors"].iteritems()]
reason = ", ".join(errors) reason = ", ".join(errors)
status = False status = False
log.error('%s error %s reason: %s %s' % log.error('%s error %s reason: %s %s' %
Expand Down Expand Up @@ -752,8 +752,8 @@ def create_bucket(self, bucket,
r = requests.post("".join([self.base_url, api]), r = requests.post("".join([self.base_url, api]),
params={'just_validate': 1}, data=params, params={'just_validate': 1}, data=params,
auth=(self.username, self.password)) auth=(self.username, self.password))
if r.json is not None and len(r.json['errors']) > 0: if r.json() is not None and len(r.json()['errors']) > 0:
for key, error in r.json['errors'].items(): for key, error in r.json()['errors'].items():
if key == 'replicaNumber': if key == 'replicaNumber':
log.warn(error) log.warn(error)
else: else:
Expand Down

0 comments on commit f0d0238

Please sign in to comment.