diff --git a/netbox_interface_sync/__init__.py b/netbox_interface_sync/__init__.py index 23ec7a1..de916a5 100644 --- a/netbox_interface_sync/__init__.py +++ b/netbox_interface_sync/__init__.py @@ -12,9 +12,9 @@ class Config(PluginConfig): 'exclude_virtual_interfaces': True, 'include_interfaces_panel': False, # Compare description during diff - 'compare_description': False, - # Sync or not description from device type - 'exclude_description': False + # If compare is true, description will also be synced to device + # Otherwise not. + 'compare_description': True } diff --git a/netbox_interface_sync/utils.py b/netbox_interface_sync/utils.py index d46ab9e..31d53f4 100644 --- a/netbox_interface_sync/utils.py +++ b/netbox_interface_sync/utils.py @@ -84,7 +84,7 @@ def post_components( updated = 0 keys_to_avoid = ["id"] - if config["exclude_description"]: + if not config["compare_description"]: keys_to_avoid.append("description") for i in add_to_device_component.values(): diff --git a/netbox_interface_sync/views.py b/netbox_interface_sync/views.py index 0762bb8..427bc54 100644 --- a/netbox_interface_sync/views.py +++ b/netbox_interface_sync/views.py @@ -269,7 +269,7 @@ class PowerOutletComparisonView(LoginRequiredMixin, PermissionRequiredMixin, Vie updated = 0 keys_to_avoid = ["id"] - if config["exclude_description"]: + if not config["compare_description"]: keys_to_avoid.append("description") for i in add_to_device_component.values(): @@ -406,7 +406,7 @@ class FrontPortComparisonView(LoginRequiredMixin, PermissionRequiredMixin, View) updated = 0 keys_to_avoid = ["id"] - if config["exclude_description"]: + if not config["compare_description"]: keys_to_avoid.append("description") for i in add_to_device_component.values():