Permalink
Browse files

MB-3376 - added username/password hints to error messages.

Change-Id: Id4efe699d3e17a4a9f2e9953f9d4369e76d5ce48
Reviewed-on: http://review.couchbase.org/15907
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Reviewed-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Ronnie Sun <ronnie@couchbase.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 71c7d54 commit e56a5ce4417ffdb495f67546e3450065e1710ad5 @steveyen steveyen committed May 11, 2012
Showing with 12 additions and 4 deletions.
  1. +1 −1 buckets.py
  2. +7 −3 listservers.py
  3. +4 −0 node.py
View
@@ -97,7 +97,7 @@ def runCmd(self, cmd, server, port,
self.rest_cmd = self.rest_cmd + '/controller/doFlush'
opts = {}
- opts['error_msg'] = "unable to %s" % cmd
+ opts['error_msg'] = "unable to %s; please check your username (-u) and password (-p);" % cmd
opts['success_msg'] = "%s" % cmd
data = rest.restCmd(methods[cmd], self.rest_cmd,
self.user, self.password, opts)
View
@@ -75,7 +75,11 @@ def printNodes(self, nodes):
if self.cmd == "host-list":
print node['hostname']
else:
+ if node.get('otpNode') is None:
+ raise Exception("could not access node;" +
+ " please check your username (-u) and password (-p)")
+
print '%s %s %s %s' % (node['otpNode'],
- node['hostname'],
- node['status'],
- node['clusterMembership'])
+ node['hostname'],
+ node['status'],
+ node['clusterMembership'])
View
@@ -333,6 +333,10 @@ def getNodeOtps(self, to_eject=[], to_failover=[], to_readd=[]):
readd_otps = []
for node in known_nodes_list:
+ if node.get('otpNode') is None:
+ raise Exception("could not access node;" +
+ " please check your username (-u) and password (-p)")
+
known_otps.append(node['otpNode'])
if node['hostname'] in to_eject:
eject_otps.append(node['otpNode'])

0 comments on commit e56a5ce

Please sign in to comment.