Add deprecation warning on st2ctl start if st2/python is python 2.x#5044
Merged
Add deprecation warning on st2ctl start if st2/python is python 2.x#5044
Conversation
Contributor
Author
arm4b
reviewed
Sep 22, 2020
| 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" |
Member
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
That should be easy enough to add - will do.
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
Cool - will fix that up as well. And also try and remember the bit of ST2 I stole it from!
Contributor
Author
There was a problem hiding this comment.
arm4b
reviewed
Sep 25, 2020
Co-authored-by: Eugen C. <stackstorm@armab.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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