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

generator.py fails silently if you specify an invalid --type #12765

Closed
fearful-symmetry opened this issue Jul 3, 2019 · 1 comment
Closed
Assignees
Labels
:Generator Related to code generators for building custom Beats or modules. Team:Integrations Label for the Integrations team

Comments

@fearful-symmetry
Copy link
Contributor

For confirmed bugs, please report:

  • Version: master
  • Operating System: any
  • Steps to Reproduce:
python ${GOPATH}/src/github.com/elastic/beats/script/generate.py --type=fakebeat --project_name=examplebeat

Since fakebeat doesn't exist, nothing happens. The script exits zero, no message is printed.

This is presumably because the python script is iterating over a directory that doesn't exist:

 for root, dirs, files in os.walk(template_path + '/' + beat_type + '/{beat}'):

According to the pydoc, os.walk will ignore errors by default. We should either specify some error handling for os.walk, or check the validity of the type before hand.

@fearful-symmetry fearful-symmetry added :Generator Related to code generators for building custom Beats or modules. Team:Integrations Label for the Integrations team labels Jul 3, 2019
@fearful-symmetry fearful-symmetry self-assigned this Jul 3, 2019
@fearful-symmetry
Copy link
Contributor Author

Fix has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Generator Related to code generators for building custom Beats or modules. Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

1 participant