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

"local variable 'ret' referenced before assignment" in storm.py

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      In https://github.com/apache/storm/blob/master/bin/storm.py#L142

      # If given path is a dir, make it a wildcard so the JVM will include all JARs in the directory.
      def get_wildcard_dir(path):
          if os.path.isdir(path):
              ret = [(os.path.join(path, "*"))]
          elif os.path.exists(path):
              ret = [path]
          return ret
      

      It's possible to get

        File "/tmp/verify-release/apache-storm-2.0.0/bin/storm.py", line 147, in get_wildcard_dir
          return ret
      UnboundLocalError: local variable 'ret' referenced before assignment
      

      because there is no "else" branch.

      Attachments

        Issue Links

          Activity

            People

              ethanli Ethan Li
              ethanli Ethan Li
              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 - 20m
                  20m