Skip to content
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

Changes search pattern for Storm version #255

Merged
merged 2 commits into from
May 12, 2016

Conversation

Darkless012
Copy link
Contributor

Fixes issue 254

@@ -267,7 +267,7 @@ def local_storm_version():
"\nSTDERR:\n{}".format(cmd, res.stdout,
res.stderr))

pattern = r'^Storm ([0-9.]+)'
pattern = r'Storm ([0-9.]+)'
return parse_version(re.findall(pattern, res.stdout)[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually thing the correct fix here would be to change this line to be:

return parse_version(re.findall(pattern, res.stdout, flags=re.MULTILINE)[0])

since we really only want to match it at the beginning of a line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Made new commit. Tested locally - works also.

@dan-blanchard
Copy link
Member

Thanks for the fix!

@dan-blanchard dan-blanchard merged commit 981e8d9 into pystorm:master May 12, 2016
@jrgoulet
Copy link

was this supposed to be fixed?

vagrant@vagrant-ubuntu-trusty-64:~/wordcount$ sparse --version
sparse 3.11.0
vagrant@vagrant-ubuntu-trusty-64:~/wordcount$ sparse run
Traceback (most recent call last):
  File "/usr/local/bin/sparse", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/streamparse/cli/sparse.py", line 79, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/streamparse/cli/run.py", line 102, in main
    env_name=args.environment)
  File "/usr/local/lib/python2.7/dist-packages/streamparse/cli/run.py", line 46, in run_local_topology
    local_version = local_storm_version()
  File "/usr/local/lib/python2.7/dist-packages/streamparse/util.py", line 358, in local_storm_version
    return parse_version(re.findall(pattern, res.stdout, flags=re.MULTILINE)[0])
IndexError: list index out of range
vagrant@vagrant-ubuntu-trusty-64:~/wordcount$ storm version
0.9.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants