-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Add deprecation warning on st2ctl start if st2/python is python 2.x #5044
Conversation
@@ -87,6 +87,11 @@ function st2start() { | |||
for COM in ${COMPONENTS}; do | |||
service_manager ${COM} start | |||
done | |||
PYTHON_VERSION=$(/opt/stackstorm/st2/bin/python --version 2>&1 | awk '{print $2'} | awk -F"." '{print $1}') | |||
if [ "${PYTHON_VERSION}" = "2" ]; then | |||
echo -e "\e[33mDeprecation warning: Support for python 2 will be removed in future StackStorm releases. Please ensure that all packs used are python 3 compatible. Your StackStorm installation may be upgraded from python 2 to python 3 in future platform releases. It is recommended to plan the manual migration to a python 3 native platform, e.g. Ubuntu 18.04 LTS or CentOS/RHEL 8. \e[0m\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks nice!
Can we include the Deprecation warning for the st2ctl reload/register actions as well to make it even more visible so users can't ignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be easy enough to add - will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major, but the second awk is redundant. A single call to awk
can give the python major version, as follows
$ python --version 2>&1
Python 3.6.11
$ python --version 2>&1 | awk -F"[. ]" '{print $2}'
3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - will fix that up as well. And also try and remember the bit of ST2 I stole it from!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
Thanks @nzlosh for additional awk tips!
Add warning messages in yellow to screen if perform st2ctl start (or restart) and /opt/stackstorm/st2/bin/python is python 2.x
Addresses part of #5041 and #4938