Permalink
Browse files

fix all places where .json is used instead of .json()

  • Loading branch information...
1 parent 3c694c3 commit f0d0238db20f6e0189192b6c0af2e0ce4871d3c8 Kyle Vogt committed Dec 18, 2012
Showing with 9 additions and 9 deletions.
  1. +1 −1 couchbase/client.py
  2. +8 −8 couchbase/rest_client.py
View
@@ -343,7 +343,7 @@ def design_docs(self):
r = requests.get(api, auth=(self.server.rest_username,
self.server.rest_password))
ddocs = []
- for ddoc in r.json.get('rows'):
+ for ddoc in r.json().get('rows'):
ddocs.append(DesignDoc(ddoc['doc']['meta']['id'],
ddoc['doc']['json'], bucket=self))
View
@@ -174,7 +174,7 @@ def __init__(self, serverInfo):
self.base_url = "http://{0}:{1}".format(self.ip, self.port)
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 self.couch_api_base is None:
#couchApiBase is not in node config before Couchbase Server 2.0
@@ -307,15 +307,15 @@ def _http_request(self, api, method='GET', params=None, headers=None,
else:
reason = "unknown"
status = False
- if r.json is None:
+ if r.json() is None:
reason = r.text
status = False
- elif "error" in r.json:
- reason = r.json["error"]
+ elif "error" in r.json():
+ reason = r.json()["error"]
status = False
- elif "errors" in r.json:
+ elif "errors" in r.json():
errors = [error for _, error in
- r.json["errors"].iteritems()]
+ r.json()["errors"].iteritems()]
reason = ", ".join(errors)
status = False
log.error('%s error %s reason: %s %s' %
@@ -752,8 +752,8 @@ def create_bucket(self, bucket,
r = requests.post("".join([self.base_url, api]),
params={'just_validate': 1}, data=params,
auth=(self.username, self.password))
- if r.json is not None and len(r.json['errors']) > 0:
- for key, error in r.json['errors'].items():
+ if r.json() is not None and len(r.json()['errors']) > 0:
+ for key, error in r.json()['errors'].items():
if key == 'replicaNumber':
log.warn(error)
else:

0 comments on commit f0d0238

Please sign in to comment.