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

osfv: check snipeit confirm and inform clearly how to set it up #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osfv_cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ osfv_cli = "osfv.cli.cli:main"

[tool.poetry]
name = "osfv"
version = "0.5.9"
version = "0.5.10"
description = "Open Source Firmware Validation Command Line Interface Tool"
authors = ["Maciej Pijanowski <[email protected]>"]
include = ["src/models/*.yml"]
Expand Down
5 changes: 4 additions & 1 deletion osfv_cli/src/osfv/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,10 @@ def main():

args = parser.parse_args()

snipeit_api = SnipeIT()
try:
snipeit_api = SnipeIT()
except Exception as e:
exit(f"Error initializing SnipeIT library: {e}")

if args.command == "snipeit":
if args.snipeit_cmd == "list_used":
Expand Down
4 changes: 3 additions & 1 deletion osfv_cli/src/osfv/libs/snipeit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def load_snipeit_config(self):
with open(self.SNIPEIT_CONFIG_FILE_PATH, "r") as file:
config = yaml.safe_load(file)
except FileNotFoundError:
raise FileNotFoundError(f"Configuration file not found")
raise FileNotFoundError(
f"Configuration file not found. Create one based on: https://github.com/Dasharo/osfv-scripts/tree/main/osfv_cli"
)
except yaml.YAMLError as e:
raise ValueError(f"Error parsing YAML: {e}")

Expand Down
6 changes: 5 additions & 1 deletion osfv_cli/src/osfv/rf/snipeit_robot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import robot.api.logger
from osfv.libs.snipeit_api import SnipeIT
from robot.api.exceptions import FatalError

snipeit_api = SnipeIT()
try:
snipeit_api = SnipeIT()
except Exception as e:
raise FatalError(f"Error initializing SnipeIT library: {e}")


def snipeit_checkout(rte_ip):
Expand Down