Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3847

Fix various problems in the python PowerShell execution

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.5.0
    • storm-submit-tools
    • None

    Description

      *Reported by https://github.com/FelixEngl*

      What is the purpose of the change
      Fixing the python version check in storm.ps1, that always fails due to wrong handling of a string.
      Otherwise every windows user has to fix this file by themselves.

      Explanation
      (& python -V 2>&1) already returns a string. Accessing it with (& python -V 2>&1)[0] returns a char. Therefore the script always fails with a NullPointerException at [int]$PythonVersion.Split(".")[0].

      How was the change tested
      I ran the script (storm_python_check_test.zip) and the modified storm.ps1 on my Windows 10 Pro Machine (With Python 3.9.1, OpenJDK 15).

      When you execute the attached script you get the following console output:

      Original Version:

      PythonVersion=
      error
      Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
      In \storm_python_check_test.ps1:11 Zeichen:3
      + $PythonMajor = [int]$PythonVersion.Split(".")[0];
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: ( [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull

      Fixed Version:

      PythonVersion=3.9.1
      PythonMajor=3
      PythonMinor=9
      PythonNumVersion=39

      Attachments

        Issue Links

          Activity

            People

              bipinprasad Bipin Prasad
              bipinprasad Bipin Prasad
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m