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

update class path for job URL #205

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ jobs:
- name: "Run Tests"
run: "poetry run invoke unittest"
changelog:
if: contains(fromJson('["develop","ltm-1.6"]'), github.base_ref)
if: |
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
(github.head_ref != 'main')
runs-on: "ubuntu-22.04"
steps:
- name: "Check out repository code"
Expand Down
1 change: 1 addition & 0 deletions changes/203.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed old reference to class path in URL pattern for job.
3 changes: 2 additions & 1 deletion nautobot_firewall_models/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Meta:
name = "Generate FW Config via Capirca."
description = "Generate FW Config via Capirca and update the models."
commit_default = True
has_sensitive_variables = False

def run(self, device): # pylint: disable=arguments-differ
"""Run a job to remove legacy reservations."""
Expand All @@ -48,7 +49,7 @@ def run(self, device): # pylint: disable=arguments-differ
device_obj = Device.objects.get(pk=dev)
logger.debug("Running against Device: `%s`", str(device_obj))
CapircaPolicy.objects.update_or_create(device=device_obj)
logger.info(obj=device_obj, message=f"{device_obj} Updated")
logger.info(f"{device_obj} Updated", extra={"object": device_obj})


jobs = [RunCapircaJob]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<div class="panel-heading">
<strong>Capirca Firewall Configurations</strong> -
<a href="{% url 'plugins:nautobot_firewall_models:capircapolicy_devicedetail' pk=object.pk %}"><i class="mdi mdi-file-document-outline"></i></a>
<a href="{% url 'extras:job' class_path='plugins-nautobot_firewall_models-jobs-runcapircajob/run' %}?device={{ object.pk }}"><i class="mdi mdi-play-circle" title="Execute Capirca Jobs"></i></a>
<a href="{% url 'extras:job_run_by_class_path' class_path='nautobot_firewall_models.jobs.RunCapircaJob' %}?device={{ object.pk }}"><i class="mdi mdi-play-circle" title="Execute Capirca Jobs"></i></a>
</div>
</div>