Skip to content

Commit

Permalink
fix logic for getsettings unknown devicetype
Browse files Browse the repository at this point in the history
  • Loading branch information
indy-independence committed Mar 22, 2024
1 parent 5bd9653 commit 2147a93
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/cnaas_nms/db/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,14 @@ def get_settings(
raise ValueError("It's not possible to get settings for devices with type UNKNOWN")

Check warning on line 594 in src/cnaas_nms/db/settings.py

View check run for this annotation

Codecov / codecov/patch

src/cnaas_nms/db/settings.py#L593-L594

Added lines #L593 - L594 were not covered by tests
else:
logger.warning("Device type is UNKNOWN, trying to get settings for hostname {}".format(hostname))

Check warning on line 596 in src/cnaas_nms/db/settings.py

View check run for this annotation

Codecov / codecov/patch

src/cnaas_nms/db/settings.py#L596

Added line #L596 was not covered by tests
settings, settings_origin = read_settings(
local_repo_path,
[device_type.name.lower(), "base_system.yml"],
"devicetype->base_system.yml",
settings,
settings_origin,
)
else:
settings, settings_origin = read_settings(
local_repo_path,
[device_type.name.lower(), "base_system.yml"],
"devicetype->base_system.yml",
settings,
settings_origin,
)
if hostname:
get_type = "hostname {}".format(hostname)
settings, settings_origin = read_settings(
Expand Down

0 comments on commit 2147a93

Please sign in to comment.