cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mish...@apache.org
Subject [1/6] git commit: Make cqlsh prompt for a password if the user doesn't enter one.
Date Fri, 21 Mar 2014 18:46:38 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 6b6139cc8 -> 37b941067
  refs/heads/cassandra-2.1 25af168c0 -> 35b7da4d0
  refs/heads/trunk a161f088c -> 2e48e0c43


Make cqlsh prompt for a password if the user doesn't enter one.

patch by J.B. Langston; reviewed by Mikhail Stepura for CASSANDRA-6902


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/37b94106
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/37b94106
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/37b94106

Branch: refs/heads/cassandra-2.0
Commit: 37b9410675b93843bc8223e57621a10dd841c291
Parents: 6b6139c
Author: J.B. Langston <jblangston@datastax.com>
Authored: Fri Mar 21 11:42:06 2014 -0700
Committer: Mikhail Stepura <mishail@apache.org>
Committed: Fri Mar 21 11:42:06 2014 -0700

----------------------------------------------------------------------
 bin/cqlsh | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/37b94106/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 4669cda..6fa3afe 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -51,6 +51,7 @@ import locale
 import platform
 import warnings
 import csv
+import getpass
 
 
 readline = None
@@ -467,6 +468,10 @@ class Shell(cmd.Cmd):
         self.hostname = hostname
         self.port = port
         self.transport_factory = transport_factory
+
+        if username and not password:
+            password = getpass.getpass()
+
         self.username = username
         self.password = password
         self.keyspace = keyspace


Mime
View raw message