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

Release v2.6.0 #429

Merged
merged 54 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
aa1f6b1
Added SNOW delete method
collin-wicker Nov 2, 2023
72195e7
Update jobs.py
collin-wicker Nov 2, 2023
a8850a2
Fixed caching mechanism, removed try/except block from delete as it w…
collin-wicker Nov 7, 2023
295e867
Merge pull request #1 from collin-wicker/ssot_snow_delete_function
collin-wicker Nov 7, 2023
9ecff49
made minor changes for linting tests
collin-wicker Nov 7, 2023
c3a8bf4
Merge pull request #2 from collin-wicker/develop
collin-wicker Nov 7, 2023
8fc3657
wip: Add external integration for ExampleDataSource
snaselj Mar 19, 2024
43cfa6e
feat: Add ExternalIntegration to AristaCV
snaselj Mar 21, 2024
b904ffe
chore: Added changelog fragment
snaselj Mar 21, 2024
2fa4a38
Merge pull request #403 from nautobot/main
Kircheneer Mar 21, 2024
042926b
feat: Add `aristacv_external_integration_name` plugin config option
snaselj Mar 25, 2024
7821182
cleanup
snaselj Mar 25, 2024
8d5c4b0
fix: 🐛 Correct issues with Example Jobs
jdrew82 Mar 25, 2024
ddfcdd9
feat: ✨ Update examples to handle in Role, Platform, Manufacturer, De…
jdrew82 Mar 25, 2024
78f9051
style: 🚨 Fix formatting for black
jdrew82 Mar 25, 2024
1969807
style: 🚨 Try again
jdrew82 Mar 25, 2024
7f19d4b
docs: 📝 Add changelog snippets
jdrew82 Mar 25, 2024
6530d6e
Update logic for App config check for 'hide_example_jobs'.
Mar 26, 2024
5e96e72
Update docs description for 'hide_example_jobs'.
Mar 26, 2024
6f68e2d
Correct logic, assertion is a negative.
Mar 26, 2024
e5f8d93
Add changelog breadcrumb.
Mar 26, 2024
fbe51da
Code formatter CI check.
Mar 26, 2024
6bb0b31
fix: 🐛 Correct logger to be off job
jdrew82 Mar 26, 2024
ec9f45a
fix: 🔥 Remove extraneous diffsync_flags call
jdrew82 Mar 26, 2024
8f7f80c
refactor: ♻️ Breakout each load into own function
jdrew82 Mar 26, 2024
10e38c9
Merge pull request #408 from MeganerdDev/nh-plugin-config-patch
Kircheneer Mar 27, 2024
7ab8e8f
Fix tagging and cf updates for objects synced to/from Infoblox.
progala Mar 27, 2024
9167091
Add change fragment.
progala Mar 27, 2024
227f667
Fix IPFabric technology calls to us `all`
jmcgill298 Apr 2, 2024
4780efb
Fix test case for contrib
jmcgill298 Apr 2, 2024
d66903c
feat: Demo job script
snaselj Apr 4, 2024
6e4c42b
Merge pull request #410 from progala/progala-fix-infoblox-tags-and-cfs
Kircheneer Apr 4, 2024
04b9110
Merge pull request #413 from nautobot/jacobm/ipfabric/fix-technology-…
Kircheneer Apr 4, 2024
00968b2
Improve IPFabric matching of InterfaceTypes
jmcgill298 Apr 3, 2024
32f4efd
unpins dependencies
Kircheneer Apr 10, 2024
18d7e6d
Merge pull request #418 from Kircheneer/u/Kircheneer-unpin-dependencies
Kircheneer Apr 10, 2024
e230203
Merge pull request #405 from nautobot/patch-fix_example_jobs
jdrew82 Apr 10, 2024
ad542e7
Merge remote-tracking branch 'origin/develop' into u/snaselj-napps-27…
snaselj Apr 10, 2024
a7019fd
Merge branch 'u/snaselj-napps-276-external-integrations' into u/snase…
snaselj Apr 10, 2024
cfbadc6
Merge pull request #415 from nautobot/u/snaselj-napps-282-jobs-script
jdrew82 Apr 10, 2024
c190f62
Update nautobot_ssot/integrations/aristacv/utils/nautobot.py
snaselj Apr 11, 2024
f6a10c4
opens prometheus-client dependency range and removes direkt drf-spect…
Kircheneer Apr 12, 2024
f783b12
Merge pull request #421 from Kircheneer/u/Kircheneer-remove-direct-de…
Kircheneer Apr 12, 2024
58716bc
Merge pull request #398 from nautobot/u/snaselj-napps-276-external-in…
jdrew82 Apr 16, 2024
09e36c3
Merge pull request #263 from collin-wicker/ssot_snow_delete_function
jdrew82 Apr 16, 2024
6e2116e
Merge pull request #414 from nautobot/jacobm/ipfabric/interface-types
jdrew82 Apr 16, 2024
af716c6
build: Bump version and update release notes
jdrew82 Apr 16, 2024
1965fbd
docs: 📝 Add release notes for 1.6.4
jdrew82 Apr 16, 2024
3e92d2a
docs: 📝 Fix release notes title
jdrew82 Apr 16, 2024
7453464
docs: 📝 Update mkdocs for 2.6 release notes
jdrew82 Apr 16, 2024
c9e6da8
docs: 📝 Fix links in release notes for 1.6
jdrew82 Apr 16, 2024
a40a4c1
build: Add change note
jdrew82 Apr 16, 2024
84aae61
docs: 📝 Fix release notes
jdrew82 Apr 16, 2024
a9c2123
Merge pull request #427 from nautobot/release-v2.6.0
jdrew82 Apr 16, 2024
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
1 change: 1 addition & 0 deletions changes/427.housekeeping
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Created release for 2.6.0
89 changes: 89 additions & 0 deletions development/run_example_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"""Executes a job locally for testing purposes.

To run this script use the following command:

```
invoke nbshell \
--plain \
--file development/run_example_job.py \
--env RUN_SSOT_TARGET_JOB=False \
--env RUN_SSOT_JOB_DRY_RUN=True
```

Passing environment variables to the script is optional. The script will default to running the data source job with a dry run enabled.
"""

import json
import os

from django.core.management import call_command
from nautobot.core.settings_funcs import is_truthy
from nautobot.extras.choices import SecretsGroupAccessTypeChoices
from nautobot.extras.choices import SecretsGroupSecretTypeChoices
from nautobot.extras.models import ExternalIntegration
from nautobot.extras.models import Job
from nautobot.extras.models import Secret
from nautobot.extras.models import SecretsGroup
from nautobot.extras.models import SecretsGroupAssociation

_TOKEN = 40 * "a"
os.environ["NAUTOBOT_DEMO_TOKEN"] = _TOKEN

_NAUTOBOT_DEMO_URL = "https://demo.nautobot.com"
_DRY_RUN = is_truthy(os.getenv("RUN_SSOT_JOB_DRY_RUN", "True"))

module_name = "nautobot_ssot.jobs.examples"
is_target_job = is_truthy(os.getenv("RUN_SSOT_TARGET_JOB", "False"))
job_class_name = "ExampleDataTarget" if is_target_job else "ExampleDataSource"

job = Job.objects.get(module_name=module_name, job_class_name=job_class_name)
if not job.enabled:
job.enabled = True
job.validated_save()

nautobot_demo, created = ExternalIntegration.objects.get_or_create(
name="Nautobot Demo",
defaults={
"remote_url": _NAUTOBOT_DEMO_URL,
"verify_ssl": False,
},
)

if created:
secret = Secret.objects.create(
name="nautobot-demo-token",
provider="environment-variable",
parameters={"variable": "NAUTOBOT_DEMO_TOKEN"},
)
secrets_group = SecretsGroup.objects.create(name="Nautobot Demo Group")
SecretsGroupAssociation.objects.create(
secret=secret,
secrets_group=secrets_group,
access_type=SecretsGroupAccessTypeChoices.TYPE_HTTP,
secret_type=SecretsGroupSecretTypeChoices.TYPE_TOKEN,
)
nautobot_demo.secrets_group = secrets_group
nautobot_demo.validated_save()

data: dict = {
"debug": True,
"dryrun": _DRY_RUN,
"memory_profiling": False,
}

if is_target_job:
data["target"] = str(nautobot_demo.pk)
data["target_url"] = _NAUTOBOT_DEMO_URL
data["target_token"] = _TOKEN
else:
data["source"] = str(nautobot_demo.pk)
data["source_url"] = _NAUTOBOT_DEMO_URL
data["source_token"] = _TOKEN

call_command(
"runjob",
f"{module_name}.{job_class_name}",
data=json.dumps(data),
username="admin",
local=True, # Enable to run the job locally (not as a celery task)
)
6 changes: 3 additions & 3 deletions docs/admin/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ sudo systemctl restart nautobot nautobot-worker nautobot-scheduler

The app behavior can be controlled with the following list of settings:

| Key | Example | Default | Description |
| ------------------- | ------- | ------- | ---------------------------------------------------------- |
| `hide_example_jobs` | `True` | `False` | A boolean to represent whether or display the example job. |
| Key | Example | Default | Description |
| ------------------- | ------- | ------- | ----------------------------------------------------------------- |
| `hide_example_jobs` | `True` | `False` | A boolean to represent whether or not to display the example job. |

## Integrations Configuration

Expand Down
55 changes: 55 additions & 0 deletions docs/admin/release_notes/version_1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,58 @@
- [161](https://github.com/nautobot/nautobot-app-ssot/pull/161) - Reverts ChatOps dependency removal by @snaselj
- [213](https://github.com/nautobot/nautobot-app-ssot/pull/213) - fix: :bug: Several fixes in the ACI integration by @chadell
- [205](https://github.com/nautobot/nautobot-app-ssot/pull/205) - Migrate PR #164 from Arista Child Repo by @qduk

## v1.6.1 - 2024-02-21

## Fixed

- [243](https://github.com/nautobot/nautobot-app-ssot/pull/243) - Fix Infoblox import_subnet for ltm-1.6 by @jdrew82
- [261](https://github.com/nautobot/nautobot-app-ssot/pull/261) - Fix Device42 documentation. by @jdrew82

## Changed

- [245](https://github.com/nautobot/nautobot-app-ssot/pull/245) - IPFabric integration settings updates by @alhogan

- [357](https://github.com/nautobot/nautobot-app-ssot/pull/357) - Backport contrib changes to LTM by @Kircheneer
- [361](https://github.com/nautobot/nautobot-app-ssot/pull/361) - Backport of #350 by @Kircheneer
- [363](https://github.com/nautobot/nautobot-app-ssot/pull/363) - Backport #362 by @Kircheneer

## v1.6.2 - 2024-03-12

## Fixed

- [386](https://github.com/nautobot/nautobot-app-ssot/pull/386) - Fixes bug in backport of contrib custom relationship handling

## Changed

- [386](https://github.com/nautobot/nautobot-app-ssot/pull/386) - Improves error handling in contrib (backport of #374)
- [373](https://github.com/nautobot/nautobot-app-ssot/pull/373) - Change contrib.NautobotModel.get_from_db to use a PK (backport of #371)

## v1.6.3 - 2024-03-20

## Fixed

- [396](https://github.com/nautobot/nautobot-app-ssot/pull/396) - Fix custom one-to-many relationships (backport of #393)
- [396](https://github.com/nautobot/nautobot-app-ssot/pull/396) - Use `typing.get_args` in favor of accessing `__args__` directly (backport of #390)
- [396](https://github.com/nautobot/nautobot-app-ssot/pull/396) - Fixed issue with generic relationships and `NautobotAdapter.load` (backport of #388)
- [396](https://github.com/nautobot/nautobot-app-ssot/pull/396) - Allow foreign keys inside of many to many relationships (backport of #377)

## Housekeeping

- Replicate module and test module structure for contrib code in LTM branch

## v1.6.4 - 2024-04-16

## Fixed

- [243](https://github.com/nautobot/nautobot-app-ssot/pull/243) - Fix Infoblox import_subnet for ltm-1.6 by @jdrew82
- [261](https://github.com/nautobot/nautobot-app-ssot/pull/261) - Fix Device42 documentation. by @jdrew82
- [419](https://github.com/nautobot/nautobot-app-ssot/pull/419) - Fix Device42 Plugin Settings for LTM by @jdrew82

## Changed

- [245](https://github.com/nautobot/nautobot-app-ssot/pull/245) - IPFabric integration settings updates by @alhogan
- [357](https://github.com/nautobot/nautobot-app-ssot/pull/357) - backport contrib changes to LTM by @Kircheneer
- [361](https://github.com/nautobot/nautobot-app-ssot/pull/361) - Backport of #350 by @Kircheneer
- [363](https://github.com/nautobot/nautobot-app-ssot/pull/363) - Backport #362 by @Kircheneer
- [373](https://github.com/nautobot/nautobot-app-ssot/pull/373) - change contrib.NautobotModel.get_from_db to use a PK by @Kircheneer
25 changes: 25 additions & 0 deletions docs/admin/release_notes/version_2.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# v2.6 Release Notes

## [v2.6.0 (2024-04-16)](https://github.com/nautobot/nautobot-app-ssot/releases/tag/v2.6.0)

### Added

- [#367](https://github.com/nautobot/nautobot-app-ssot/issues/367) - Added support of Roles, Platforms, Manufacturers, DeviceTypes, and Devices to example Jobs.

### Changed

- [#398](https://github.com/nautobot/nautobot-app-ssot/issues/398) - Changed Arista Cloud Vision jobs to optionally use ExternalIntegration.
- [#414](https://github.com/nautobot/nautobot-app-ssot/issues/414) - Changed IPFabric interface media matching to fall back on interface names.

### Fixed

- [#367](https://github.com/nautobot/nautobot-app-ssot/issues/367) - Fixed issues with example Jobs.
- [#407](https://github.com/nautobot/nautobot-app-ssot/issues/407) - Fixed logic check for 'hide_example_jobs' when defined, and also set to False.
- [#409](https://github.com/nautobot/nautobot-app-ssot/issues/409) - Fixed tagging and custom field updates for Nautobot objects synced to/from Infoblox.
- [#413](https://github.com/nautobot/nautobot-app-ssot/issues/413) - Fixed method of retrieving objects from IPFabric's technology categories.

### Housekeeping

- [#418](https://github.com/nautobot/nautobot-app-ssot/issues/418) - Unpins multiple dependencies.
- [#421](https://github.com/nautobot/nautobot-app-ssot/issues/421) - Opened prometheus-client dependency range and removed direct drf-spectacular dependency.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ nav:
- Compatibility Matrix: "admin/compatibility_matrix.md"
- Release Notes:
- "admin/release_notes/index.md"
- v2.6: "admin/release_notes/version_2.6.md"
- v2.5: "admin/release_notes/version_2.5.md"
- v2.4: "admin/release_notes/version_2.4.md"
- v2.3: "admin/release_notes/version_2.3.md"
Expand Down
1 change: 1 addition & 0 deletions nautobot_ssot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class NautobotSSOTAppConfig(NautobotAppConfig):
"aristacv_from_cloudvision_default_site": "",
"aristacv_hostname_patterns": [],
"aristacv_import_active": False,
"aristacv_external_integration_name": "",
"aristacv_role_mappings": {},
"aristacv_site_mappings": {},
"aristacv_verify": True,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
"""Storage of data that will not change throughout the life cycle of the application."""

from django.conf import settings


def _read_settings() -> dict:
config = settings.PLUGINS_CONFIG["nautobot_ssot"]
return config


APP_SETTINGS = _read_settings()
ARISTA_PLATFORM = "arista.eos.eos"
CLOUDVISION_PLATFORM = "Arista EOS-CloudVision"
DEFAULT_APPLY_IMPORT_TAG = False
DEFAULT_CREATE_CONTROLLER = False
DEFAULT_CVAAS_URL = "https://www.arista.io"
DEFAULT_DELETE_DEVICES_ON_SYNC = False
DEFAULT_DEVICE_ROLE = "network"
DEFAULT_DEVICE_ROLE_COLOR = "ff0000"
DEFAULT_DEVICE_STATUS = "cloudvision_imported"
DEFAULT_DEVICE_STATUS_COLOR = "ff0000"
DEFAULT_IMPORT_ACTIVE = False
DEFAULT_SITE = "cloudvision_imported"
DEFAULT_VERIFY_SSL = True

PORT_TYPE_MAP = {
"xcvr1000BaseT": "1000base-t",
Expand Down Expand Up @@ -83,7 +87,3 @@ def _read_settings() -> dict:
"400GBASE-2FR4": "400gbase-x-osfp",
"400GBASE-ZR": "400gbase-x-qsfpdd",
}

CLOUDVISION_PLATFORM = "Arista EOS-CloudVision"

ARISTA_PLATFORM = "arista.eos.eos"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from diffsync import DiffSync
from diffsync.exceptions import ObjectAlreadyExists, ObjectNotFound

from nautobot_ssot.integrations.aristacv.constant import APP_SETTINGS
from nautobot_ssot.integrations.aristacv.diffsync.models.cloudvision import (
CloudvisionCustomField,
CloudvisionDevice,
Expand All @@ -17,6 +16,7 @@
CloudvisionIPAddress,
CloudvisionIPAssignment,
)
from nautobot_ssot.integrations.aristacv.types import CloudVisionAppConfig
from nautobot_ssot.integrations.aristacv.utils import cloudvision


Expand All @@ -41,8 +41,13 @@ def __init__(self, *args, job=None, conn: cloudvision.CloudvisionApi, **kwargs):

def load_devices(self):
"""Load devices from CloudVision."""
if APP_SETTINGS.get("aristacv_create_controller"):
cvp_version = cloudvision.get_cvp_version()
config: CloudVisionAppConfig = self.job.app_config
if config.hostname_patterns and not (config.site_mappings and config.role_mappings):
self.job.logger.warning(
"Configuration found for aristacv_hostname_patterns but no aristacv_site_mappings or aristacv_role_mappings. Please ensure your mappings are defined."
)
if config.create_controller:
cvp_version = cloudvision.get_cvp_version(config)
cvp_ver_cf = self.cf(name="arista_eos", value=cvp_version, device_name="CloudVision")
try:
self.add(cvp_ver_cf)
Expand Down Expand Up @@ -258,10 +263,4 @@ def load_device_tags(self, device):

def load(self):
"""Load devices and associated data from CloudVision."""
if APP_SETTINGS.get("aristacv_hostname_patterns") and not (
APP_SETTINGS.get("aristacv_site_mappings") and APP_SETTINGS.get("aristacv_role_mappings")
):
self.job.logger.warning(
"Configuration found for aristacv_hostname_patterns but no aristacv_site_mappings or aristacv_role_mappings. Please ensure your mappings are defined."
)
self.load_devices()
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from diffsync import DiffSync
from diffsync.exceptions import ObjectNotFound, ObjectAlreadyExists

from nautobot_ssot.integrations.aristacv.constant import APP_SETTINGS
from nautobot_ssot.integrations.aristacv.diffsync.models.nautobot import (
NautobotDevice,
NautobotCustomField,
Expand All @@ -21,6 +20,7 @@
NautobotIPAssignment,
NautobotPort,
)
from nautobot_ssot.integrations.aristacv.types import CloudVisionAppConfig
from nautobot_ssot.integrations.aristacv.utils import nautobot


Expand Down Expand Up @@ -166,8 +166,9 @@ def sync_complete(self, source: DiffSync, *args, **kwargs):
self.job.logger.warning(f"Deletion failed for protected object: {nautobot_object}. {err}")
self.objects_to_delete[grouping] = []

config: CloudVisionAppConfig = self.job.app_config # type: ignore
# if Controller is created we need to ensure all imported Devices have RelationshipAssociation to it.
if APP_SETTINGS.get("aristacv_create_controller"):
if config.create_controller:
self.job.logger.info("Creating Relationships between CloudVision and connected Devices.")
controller_relation = OrmRelationship.objects.get(label="Controller -> Device")
device_ct = ContentType.objects.get_for_model(OrmDevice)
Expand Down
Loading
Loading