You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bi...@apache.org on 2023/06/30 15:12:20 UTC

[storm] branch master updated: [STORM-3926] Require python3 for bin/storm (#3548)

This is an automated email from the ASF dual-hosted git repository.

bipinprasad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a48fbecb [STORM-3926] Require python3 for bin/storm (#3548)
5a48fbecb is described below

commit 5a48fbecba45c45c69c752fb04126305c203d876
Author: Bipin Prasad <bi...@apache.org>
AuthorDate: Fri Jun 30 08:12:14 2023 -0700

    [STORM-3926] Require python3 for bin/storm (#3548)
    
    * [STORM-3926] Require python3 for bin/storm
    
    * [STORM-3926] Update Poweshell script to use python3.
---
 bin/storm     | 6 +++---
 bin/storm.ps1 | 8 ++++----
 bin/storm.py  | 3 +--
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/bin/storm b/bin/storm
index f30f05f02..65e3bda45 100755
--- a/bin/storm
+++ b/bin/storm
@@ -35,13 +35,13 @@ done
 
 # check for version
 if [ -z $PYTHON ]; then
-  PYTHON="/usr/bin/env python"
+  PYTHON="/usr/bin/env python3"
 fi
 majversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f1`
 minversion=`$PYTHON -V 2>&1 | awk '{print $2}' | cut -d'.' -f2`
 numversion=$(( 10 * $majversion + $minversion))
-if (( $numversion < 26 )); then
-  echo "Need python version > 2.6"
+if (( $numversion < 30 )); then
+  echo "Need Python version > 3.0"
   exit 1
 fi
 
diff --git a/bin/storm.ps1 b/bin/storm.ps1
index 0b1220aeb..b98bdee83 100644
--- a/bin/storm.ps1
+++ b/bin/storm.ps1
@@ -23,12 +23,12 @@ while((Get-Item $PRG).LinkType -eq "SymbolicLink") {
 }
 
 # Check for Python version
-$PythonVersion = (& python -V 2>&1).Split(" ")[1];
+$PythonVersion = (& python3 -V 2>&1).Split(" ")[1];
 $PythonMajor = [int]$PythonVersion.Split(".")[0];
 $PythonMinor = [int]$PythonVersion.Split(".")[1];
 $PythonNumVersion = $PythonMajor * 10 + $PythonMinor;
-if($PythonNumVersion -le 26) {
-  Write-Output "Need python version > 2.6";
+if($PythonNumVersion -le 30) {
+  Write-Output "Need Python version > 3.0";
   exit 1;
 }
 
@@ -64,6 +64,6 @@ if(Test-Path $StormEnvPath) {
 }
 
 $ArgsForProcess = @(([io.path]::combine("$STORM_BIN_DIR", "storm.py"))) + $args
-Start-Process -FilePath python -ArgumentList $ArgsForProcess -Wait -NoNewWindow
+Start-Process -FilePath python3 -ArgumentList $ArgsForProcess -Wait -NoNewWindow
 
 exit $LastExitCode
diff --git a/bin/storm.py b/bin/storm.py
index ed51fc20a..6d7374142 100755
--- a/bin/storm.py
+++ b/bin/storm.py
@@ -95,7 +95,6 @@ def confvalue(name, storm_config_opts, extrapaths, overriding_conf_file=None, da
         "-cp", get_classpath(extrajars=extrapaths, daemon=daemon), "org.apache.storm.command.ConfigValue", name
     ]
     output = subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
-    # python 3
     if not isinstance(output, str):
         output = output.decode('utf-8')
     lines = output.split(os.linesep)
@@ -905,7 +904,7 @@ def initialize_admin_subcommand(subparsers):
 def initialize_shell_subcommand(subparsers):
     command_help = """
     Archives resources to jar and uploads jar to Nimbus, and executes following arguments on "local". Useful for non JVM languages.
-    eg: `storm shell resources/ python topology.py arg1 arg2`"""
+    eg: `storm shell resources/ python3 topology.py arg1 arg2`"""
 
     sub_parser = subparsers.add_parser("shell", help=command_help, formatter_class=SortingHelpFormatter)