Closed slavavrn closed 3 months ago
@fruch - thoughts?
From a quick look
That seems broken in
https://github.com/scylladb/scylla-cqlsh/commit/3230389058ba8cd467461e39966b8ef4dfe4e3a1
There is no real test coverage for that specific file, not sure why 2 configuration files are supported to begin with.
Anyhow @slavavrn you think you can issue a PR with the fix you suggested ?
We should also report it upstream (I'm guessing it's still broken there as well)
Based on the commit comment, 2 config files are supported because https://issues.apache.org/jira/browse/CASSANDRA-16983
But, in my opinion, it is also need to be fixed the notify output to stderr - the notify should be sent to stdout:
print("\nNotice: Credentials in the cqlshrc file is deprecated and will be ignored in the future."
"\nPlease use a credentials file to specify the username and password.\n", file=sys.stderr)
Yes I can issue a PR
In the cqlsh.py there is code that checks where the login and password are read from:
If they are read from cqlshrc, a notification is issued to stderr. However, further in the code, the data from the file ~/.cassandra/credentials (or specified in the --credentials parameter) is ignored:
It is necessary to read data from credentials file like this:
In fact, the notification sent to stderr is also erroneous
Link to the problematic code section: https://github.com/scylladb/scylla-cqlsh/blob/9d198006aa3dcb8d2afeb391479fdc28b7eaee5c/bin/cqlsh.py#L2491C1-L2507C113