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

add scope fails when tag is not present #196

Closed
SkillfulHacking opened this issue Oct 22, 2019 · 2 comments · Fixed by #197
Closed

add scope fails when tag is not present #196

SkillfulHacking opened this issue Oct 22, 2019 · 2 comments · Fixed by #197
Labels
bug Something isn't working server affecting natlas-server

Comments

@SkillfulHacking
Copy link

SkillfulHacking commented Oct 22, 2019

Affecting:
Server

Version:
main branch

Describe the bug
unable to add scope due to missing tags

To Reproduce
Steps to reproduce the behavior:

  1. source venv
  2. python3 add-scope.py scope.txt --verbose

Expected behavior
expect scope to be added to db

Additional context

python3 add-scope.py --scope scope.txt  --verbose
Traceback (most recent call last):
  File "add-scope.py", line 58, in <module>
    main()
  File "add-scope.py", line 53, in main
    importScope(args.scope, False, args.verbose)
  File "add-scope.py", line 23, in importScope
    fail, exist, success = ScopeItem.importScope(line, blacklist)
  File "/opt/natlas2/natlas-server/app/models.py", line 156, in importScope
    if tags:
UnboundLocalError: local variable 'tags' referenced before assignment
@SkillfulHacking SkillfulHacking added the bug Something isn't working label Oct 22, 2019
@SkillfulHacking
Copy link
Author

If I add a tag to the scope file it will import to scope, however without a tag I received the above error.

@SkillfulHacking SkillfulHacking changed the title add scope issue add scope fails when tag is not present Oct 22, 2019
@0xdade 0xdade added the server affecting natlas-server label Oct 22, 2019
ajacques pushed a commit that referenced this issue Oct 23, 2019
Closes #196. Accidentally referenced a variable that wasn't always assigned.
@0xdade
Copy link
Member

0xdade commented Oct 23, 2019

Thank you for your bug report. It slipped through my testing (and since it's manual testing right now, that's especially prone to happening). Luckily it was an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server affecting natlas-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants