From 721af8e989b8bb8d458c4a2ff02ddb8ec139db61 Mon Sep 17 00:00:00 2001 From: Jeff Kala <48843785+jeffkala@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:10:40 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Joe Wesch <10467633+joewesch@users.noreply.github.com> --- docs/user/app_feature_config_plans.md | 7 ++++--- docs/user/app_feature_remediation.md | 4 ++-- .../nautobot_golden_config/compliance_device_report.html | 2 +- nautobot_golden_config/tests/test_api.py | 8 -------- pyproject.toml | 1 - 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/docs/user/app_feature_config_plans.md b/docs/user/app_feature_config_plans.md index d796124d..fbb516a2 100644 --- a/docs/user/app_feature_config_plans.md +++ b/docs/user/app_feature_config_plans.md @@ -22,9 +22,10 @@ You can view a plan by navigating to **Golden Config -> Config Plans** and choos - **Date Created**: The date the plan was generated. - **Plan Type**: The type of plan used to generate it. - **Config Set**: The set of commands to be deployed. -- **Feature** (If Applicable): The Compliance Feature the config set was generated from. +- **Features** (If Applicable): The Compliance Feature(s) the config set was generated from. - **Change Control ID** (Optional): A text field that be used for grouping and filtering plans. - **Change Control URL** (Optional): A URL field that can be used to link to an external system tracking change controls. +- **Job Result**: The Job that generated the plan(s). - **Status**: The status of the plan. ![Config Plan View](../images/config_plan-view.png) @@ -33,9 +34,9 @@ You can view a plan by navigating to **Golden Config -> Config Plans** and choos In order to generate a plan, navigate to **Golden Config -> Config Plans** and hit the **Add** button. After choosing the type of plan you want to generate, you can then filter the list of devices you want to generate a Config Plan for by selecting either the list of devices themselves or a by choosing one or more related items such as Location or Status. If you select a plan type that is derived from a Configuration Compliance object, you will have the ability to only generate plans for one or more features, but selecting no features will generate plans for all applicable features. -In addition, you have the ability to specify a Change Control ID that can be associated with all of the plans that will be generated. This can come in handy when it comes to filtering the list of plans to ultimately deploy. +In addition, you have the ability to specify a Change Control ID & URL that can be associated with all of the plans that will be generated. This can come in handy when it comes to filtering the list of plans to ultimately deploy. -Once you have selected the appropriate options, you can click the **Generate** button which will start a Job to generate the plans. You will automatically be forwarded to the Job Result output page so you can monitor the progress. +Once you have selected the appropriate options, you can click the **Generate** button which will start a Job to generate the plans. ### Screenshots diff --git a/docs/user/app_feature_remediation.md b/docs/user/app_feature_remediation.md index f90c13e3..61c9c0cf 100644 --- a/docs/user/app_feature_remediation.md +++ b/docs/user/app_feature_remediation.md @@ -57,13 +57,13 @@ Custom remediation performs a call to the remediation function every time a Comp ## Enabling Configuration Remediation -Once remediation settings are configured for a particular platform, remediation can be enabled on a per compliance feature basis. In order to enable configuration remediation for a particular feature, navigate to **Golden Config -> Compliance Rules**, and choose a rule for a platform that has remediation settings set up. Edit the compliance rule and check the box "Enable Remediation". This action effectively enables remediation for that particular Platform/Feature pair. +Once remediation settings are configured for a particular platform, remediation can be enabled on a per compliance rule basis. In order to enable configuration remediation for a particular rule, navigate to **Golden Config -> Compliance Rules**, and choose a rule for a platform that has remediation settings set up. Edit the compliance rule and check the box "Enable Remediation". This action effectively enables remediation for that particular Platform/Feature pair. ![Enable Configuration Remediation per Feature](../images/remediation_enable_compliance_rule_feature.png) ## Validating Configuration Remediation -Once remediation is configured for a particular Platform/Feature pair, it is possible to validate remediation operations by running a compliance job. Navigate to **Jobs -> Run Configuration Compliance** and run a compliance job for a device that has remediation enabled. Verify that remediation data has been generated by navigating to **Golden Config -> Compliance**, select the device and check the compliance status for the feature with remediation enabled and the "Remediating Configuration" field, as shown below: +Once remediation is configured for a particular Platform/Feature pair, it is possible to validate remediation operations by running a compliance job. Navigate to **Jobs -> Perform Configuration Compliance** and run a compliance job for a device that has remediation enabled. Verify that remediation data has been generated by navigating to **Golden Config -> Config Compliance**, select the device and check the compliance status for the feature with remediation enabled and the "Remediating Configuration" field, as shown below: ![Validate Configuration Remediation](../images/remediation_validate_feature.png) \ No newline at end of file diff --git a/nautobot_golden_config/templates/nautobot_golden_config/compliance_device_report.html b/nautobot_golden_config/templates/nautobot_golden_config/compliance_device_report.html index 3e171fcd..caf6dc3c 100644 --- a/nautobot_golden_config/templates/nautobot_golden_config/compliance_device_report.html +++ b/nautobot_golden_config/templates/nautobot_golden_config/compliance_device_report.html @@ -182,7 +182,7 @@

{% block title %}Configuration Compliance - {{ device.name }}{% endblock %}< - {% endif %} + {% endif %} {% endfor %} diff --git a/nautobot_golden_config/tests/test_api.py b/nautobot_golden_config/tests/test_api.py index 8fe78d25..4d984845 100644 --- a/nautobot_golden_config/tests/test_api.py +++ b/nautobot_golden_config/tests/test_api.py @@ -323,14 +323,6 @@ def setUpTestData(cls): def test_list_objects_brief(self): """Skipping test due to brief_fields not implemented.""" - def test_create_object(self): - """Skipping test due to POST method not allowed.""" - - def test_create_object_without_permission(self): - """Skipping test due to POST method not allowed.""" - - def test_bulk_create_objects(self): - """Skipping test due to POST method not allowed.""" # pylint: disable=too-many-ancestors,too-many-locals diff --git a/pyproject.toml b/pyproject.toml index 32c4d5dc..e85aede0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ matplotlib = "^3.3.2" nautobot = "^1.6.1" nautobot-plugin-nornir = ">=1.0.0" netutils = "^1.5.0" - # Already a dependecy of nautobot-plugin-nornir, but adding the required minimum version needed nornir-nautobot = "^2.6.0" hier-config = "^2.2.2"