Skip to content

Commit ac03053

Browse files
committed
plain text authentication
1 parent 7b28537 commit ac03053

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cqlsh-expansion/bin/cqlsh-expansion.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,15 @@ def __init__(self, hostname, port, color=False,
482482
self.auth_provider = SigV4AuthProvider(my_session)
483483
elif options.auth_provider_name == DEFAULT_AUTH_PROVIDER:
484484
if username:
485-
if not password:
486-
password = getpass.getpass()
487-
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
488-
else:
485+
if not password:
486+
password = getpass.getpass()
487+
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
488+
else:
489489
raise SyntaxError('cqlsh-expansion.py Invalid parameter for auth-provider. "%s" is not a valid AuthProvider' % (auth_provider,))
490-
elif username:
490+
else:
491+
if username:
491492
if not password:
492-
password = getpass.getpass()
493+
password = getpass.getpass()
493494
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
494495

495496
self.username = username
@@ -2488,4 +2489,4 @@ def main(options, hostname, port):
24882489
if __name__ == '__main__':
24892490
main(*read_options(sys.argv[1:], os.environ))
24902491

2491-
# vim: set ft=python et ts=4 sw=4 :
2492+
# vim: set ft=python et ts=4 sw=4 :

0 commit comments

Comments
 (0)