Skip to content

Commit 7b28537

Browse files
committed
plain text auth provider fix
1 parent bc35ac2 commit 7b28537

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cqlsh-expansion/bin/cqlsh-expansion.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,17 @@ def __init__(self, hostname, port, color=False,
480480
if options.auth_provider_name == 'SigV4AuthProvider':
481481
my_session = boto3.session.Session()
482482
self.auth_provider = SigV4AuthProvider(my_session)
483-
elif auth_provider_name == DEFAULT_AUTH_PROVIDER:
483+
elif options.auth_provider_name == DEFAULT_AUTH_PROVIDER:
484484
if username:
485485
if not password:
486486
password = getpass.getpass()
487487
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
488488
else:
489489
raise SyntaxError('cqlsh-expansion.py Invalid parameter for auth-provider. "%s" is not a valid AuthProvider' % (auth_provider,))
490-
490+
elif username:
491+
if not password:
492+
password = getpass.getpass()
493+
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
491494

492495
self.username = username
493496
self.keyspace = keyspace

0 commit comments

Comments
 (0)