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

Fix: Argument naming in pontos-update-header #790

Merged
merged 2 commits into from
Jun 7, 2023
Merged

Conversation

n-thumann
Copy link
Member

@n-thumann n-thumann commented Jun 7, 2023

What

This PR fixes the naming of the license argument. It is wrongfully accessed via license_id, so I specified a dest to store the license argument in.
An alternative approach would be to rename all occurrences to license. This however interferes with the built-in license() and hence makes pylint sad.

Why

To fix:

➜  pontos git:(main) poetry run pontos-update-header -d /tmp/test -l GPL-2.0-only    
 ℹ pontos-update-header
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/nthumann/Greenbone/pontos/pontos/updateheader/updateheader.py", line 388, in main
    _update_file(
  File "/home/nthumann/Greenbone/pontos/pontos/updateheader/updateheader.py", line 152, in _update_file
    parsed_args.license_id,
AttributeError: 'Namespace' object has no attribute 'license_id'. Did you mean: 'license'?

With this patch applied:

➜  pontos git:(fix_updateheader) poetry run pontos-update-header -d /tmp/test -l GPL-2.0-only
 ℹ pontos-update-header
/tmp/test/mgasa-2023-0001.nasl: Added license header.

References

Checklist

  • Tests

@n-thumann n-thumann requested a review from a team as a code owner June 7, 2023 14:42
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

Conventional Commits Report

Type Number
Bug Fixes 2

🚀 Conventional commits found.

@bjoernricks bjoernricks merged commit 291b3de into main Jun 7, 2023
14 checks passed
@bjoernricks bjoernricks deleted the fix_updateheader branch June 7, 2023 15:05
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.

None yet

2 participants