Skip to content

Commit 5f3f7ad

Browse files
author
Amir Biglarbegian
committed
MB-55677 Fix the eshell error with -d switch
These two functions: - get_babysitter_cookie - get_ns_server_cookie are not using a tuple as param like other rest API calls, but they are using payload instead. When the -d switch is mentioned in the eshell, this will raise an error because the payload is sent to _url_encode_params function where it expects param to be a tuple. So here we are trying to avoid that function call by checking if the parameter is actually a tuple. If not just a simple print works fine. Change-Id: I4973fe195902e1e12e2960f9fdf1d724b6614597 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/187269 Well-Formed: Restriction Checker Reviewed-by: James Lee <james.lee@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent 38c3ce2 commit 5f3f7ad

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cluster_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,10 @@ def _get(self, url, params=None):
23902390
@request
23912391
def _post_form_encoded(self, url, params):
23922392
if self.debug:
2393-
print(f'POST {url} {self._url_encode_params(params)}')
2393+
if len(params) and not isinstance(params[0], tuple):
2394+
print(f'POST {url} {params}')
2395+
else:
2396+
print(f'POST {url} {self._url_encode_params(params)}')
23942397

23952398
return self._handle_response(self.session.post(url, auth=(self.username, self.password), data=params,
23962399
verify=self.ca_cert, timeout=self.timeout, headers=self.headers))

0 commit comments

Comments
 (0)