-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
75 additions
and
16 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 |
---|---|---|
|
@@ -8,19 +8,19 @@ | |
|
||
__author__ = "Artem Kotik" | ||
__email__ = "[email protected]" | ||
__version__ = "2.6.0" | ||
__version__ = "2.7.0" | ||
|
||
|
||
class ConfigDiffConfig(PluginConfig): | ||
name = "netbox_config_diff" | ||
verbose_name = "NetBox Config Diff Plugin" | ||
description = "Find diff between the intended device configuration and actual." | ||
description = "Find diff and push rendered device configurations from NetBox to devices and apply them." | ||
author = __author__ | ||
author_email = __email__ | ||
version = __version__ | ||
base_url = "config-diff" | ||
required_settings = ["USERNAME", "PASSWORD"] | ||
min_version = "3.6.0" | ||
min_version = "3.7.0" | ||
default_settings = { | ||
"USER_SECRET_ROLE": "Username", | ||
"PASSWORD_SECRET_ROLE": "Password", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from django.db import migrations | ||
|
||
from extras.models import Script, ScriptModule | ||
from netbox.settings import VERSION | ||
|
||
|
||
def forward_func(apps, schema_editor): | ||
if VERSION.startswith("3."): | ||
return | ||
|
||
if Script.objects.filter(name="ConfigDiffScript"): | ||
return | ||
|
||
obj = None | ||
for module in ScriptModule.objects.all(): | ||
if module.python_name == "config_diff": | ||
obj = module | ||
break | ||
|
||
if obj: | ||
Script.objects.create(module=obj, name="ConfigDiffScript") | ||
|
||
|
||
def reverse_func(apps, schema_editor): | ||
if VERSION.startswith("3."): | ||
return | ||
|
||
if qs := Script.objects.filter(name="ConfigDiffScript"): | ||
qs.delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("netbox_config_diff", "0009_configcompliance_patch"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward_func, reverse_func), | ||
] |
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 |
---|---|---|
|
@@ -114,6 +114,7 @@ def get_extra_context(self, request, instance): | |
|
||
return { | ||
"job": job, | ||
"version": VERSION, | ||
} | ||
|
||
|
||
|