Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cqlsh.py: change shebang to /usr/bin/env python3 #98

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

syuu1228
Copy link
Contributor

To run python executables on scylla-python3, we need to specify /usr/bin/env python3 on shebang, otherwise the script run on /usr/bin/python3.

Fixes #97

To run python executables on scylla-python3, we need to specify
/usr/bin/env python3 on shebang, otherwise the script run on
/usr/bin/python3.

Fixes scylladb#97
Copy link
Collaborator

@fruch fruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@fruch fruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fruch
Copy link
Collaborator

fruch commented Jul 18, 2024

@syuu1228

do we have confirmation it's fixes the issue ?

@yaronkaikov
Copy link

@syuu1228 please confirm it is fixing the issue, if it is let;s get it in

@syuu1228
Copy link
Contributor Author

Here's the test result on local Rocky9 VM:

  • before the patch applied
$ /opt/scylladb/share/cassandra/bin/cqlsh.py 

Python Cassandra driver not installed, or not on PYTHONPATH.
You might try "pip install cassandra-driver".

Python: /usr/bin/python3
Module load path: ['/opt/scylladb/share/cassandra/libexec', '/opt/scylladb/share/cassandra/bin', '/opt/scylladb/share/cassandra/libexec', '/etc/yum.repos.d', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/lib64/python3.9/site-packages', '/usr/lib/python3.9/site-packages']

Error: No module named 'cassandra'

It says Python: /usr/bin/python3 since python path is hardcoded on shebang.

  • after the patch applied
$ /opt/scylladb/share/cassandra/bin/cqlsh.py
Connected to  at 127.0.0.1:9042
[cqlsh 6.0.23.dev3+g86a280a | Scylla 6.2.0~dev-0.20240812.607abe96e864 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cqlsh> 

It able to load cassndra module since it using scylla-python3.

$ ps ax|grep cqlsh
  51490 pts/0    Tl     0:00 /opt/scylladb/share/cassandra/bin/../../../python3/bin/python3 /opt/scylladb/python3/bin/../libexec/python3.12.bin -s /opt/scylladb/share/cassandra/bin/../libexec/cqlsh.py

Also, ps ax shows /opt/scylladb/python3/bin/python3 is running.

@fruch
Copy link
Collaborator

fruch commented Aug 13, 2024

On which test we are seeing this failing ?

@roydahan
Copy link
Collaborator

roydahan commented Sep 1, 2024

@fruch can we merge it?

@fruch
Copy link
Collaborator

fruch commented Sep 1, 2024

@fruch can we merge it?

We can even that I don't see it broken anywhere

@fruch fruch merged commit 44d759c into scylladb:master Sep 1, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/opt/scylladb/share/cassandra/bin/cqlsh.py mistakenly run on /usr/bin/python3
5 participants