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

Added a better error message during build when a json file is misspelled #67

Merged
merged 1 commit into from
Nov 5, 2021

Conversation

olehermanse
Copy link
Member

Before:

002 autorun     : json 'defz.json' 'masterfiles/def.json'
Traceback (most recent call last):
  File "/home/olehermanse/.local/bin/cfbs", line 8, in <module>
    sys.exit(main())
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/main.py", line 145, in main
    return commands.build_command()
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 949, in build_command
    build_steps()
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 931, in build_steps
    build_step(module, step, module_name_length)
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 872, in build_step
    assert extras is not None
AssertionError
$

After:

002 autorun     : json 'defz.json' 'masterfiles/def.json'
Error: 'defz.json' is not a file
$

Ticket: CFE-3843

Before:

```
002 autorun     : json 'defz.json' 'masterfiles/def.json'
Traceback (most recent call last):
  File "/home/olehermanse/.local/bin/cfbs", line 8, in <module>
    sys.exit(main())
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/main.py", line 145, in main
    return commands.build_command()
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 949, in build_command
    build_steps()
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 931, in build_steps
    build_step(module, step, module_name_length)
  File "/home/olehermanse/.local/lib/python3.8/site-packages/cfbs/commands.py", line 872, in build_step
    assert extras is not None
AssertionError
$
```

After:

```
002 autorun     : json 'defz.json' 'masterfiles/def.json'
Error: 'defz.json' is not a file
$
```

Ticket: CFE-3843
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
@nickanderson
Copy link
Member

This is a good improvement, thank you!

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

ACK

@olehermanse olehermanse merged commit 53590b0 into master Nov 5, 2021
@olehermanse olehermanse deleted the extras branch November 5, 2021 12:01
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

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

ACK

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

Successfully merging this pull request may close these issues.

4 participants