-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix vlans across all platforms and more unittest fix ci test to match new 2.2.3 lower constraint merge tasks.py from develop
- Loading branch information
Showing
52 changed files
with
16,780 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Sync Devices from Network job was added which utilizes the SSoT framework to onboard devices. | ||
Sync Data from Network job was added which utilizes the SSoT framework to onboard devices. | ||
Git Datasource object to be able to use a Git Repo to overload new SSoT job YAML file definitions. | ||
Create a Nornir inventory `EmptyInventory` to support ondemand inventory population for `Sync Devices` job. | ||
Add `nautobot-app-nornir` dependency to reuse `NautobotORMInventory` to support inventory creation for `Sync Data` job. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The `OnboardingTask` job is changed to `hidden` by default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
"""App Config Schema Generator and Validator.""" | ||
|
||
import json | ||
from importlib import import_module | ||
from os import getenv | ||
from pathlib import Path | ||
from urllib.parse import urlparse | ||
|
||
import jsonschema | ||
import toml | ||
from django.conf import settings | ||
from to_json_schema.to_json_schema import SchemaBuilder | ||
|
||
|
||
def _enrich_object_schema(schema, defaults, required): | ||
schema["additionalProperties"] = False | ||
for key, value in schema["properties"].items(): | ||
if required and key in required: | ||
value["required"] = True | ||
default_value = defaults and defaults.get(key, None) | ||
if value["type"] == "object" and "properties" in value: | ||
_enrich_object_schema(value, default_value, None) | ||
elif default_value is not None: | ||
value["default"] = default_value | ||
|
||
|
||
def _main(): | ||
pyproject = toml.loads(Path("pyproject.toml").read_text()) | ||
url = urlparse(pyproject["tool"]["poetry"]["repository"]) | ||
_, owner, repository = url.path.split("/") | ||
package_name = pyproject["tool"]["poetry"]["packages"][0]["include"] | ||
app_config = settings.PLUGINS_CONFIG[package_name] # type: ignore | ||
schema_path = Path(package_name) / "app-config-schema.json" | ||
command = getenv("APP_CONFIG_SCHEMA_COMMAND", "") | ||
if command == "generate": | ||
schema = { | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": f"https://raw.githubusercontent.com/{owner}/{repository}/develop/{package_name}/app-config-schema.json", | ||
"$comment": "TBD: Update $id, replace `develop` with the future release tag", | ||
**SchemaBuilder().to_json_schema(app_config), # type: ignore | ||
} | ||
app_config = import_module(package_name).config | ||
_enrich_object_schema(schema, app_config.default_settings, app_config.required_settings) | ||
schema_path.write_text(json.dumps(schema, indent=4) + "\n") | ||
print(f"\n==================\nGenerated schema:\n\n{schema_path}\n") | ||
print( | ||
"WARNING: Review and edit the generated file before committing.\n" | ||
"\n" | ||
"Its content is inferred from:\n" | ||
"\n" | ||
"- The current configuration in `PLUGINS_CONFIG`\n" | ||
"- `NautobotAppConfig.default_settings`\n" | ||
"- `NautobotAppConfig.required_settings`" | ||
) | ||
elif command == "validate": | ||
schema = json.loads(schema_path.read_text()) | ||
jsonschema.validate(app_config, schema) | ||
print( | ||
f"\n==================\nValidated configuration using the schema:\n{schema_path}\nConfiguration is valid." | ||
) | ||
else: | ||
raise RuntimeError(f"Unknown command: {command}") | ||
|
||
|
||
_main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.