Skip to content

Commit

Permalink
Merge pull request #205 from nautobot/u/whitej6-issue-203
Browse files Browse the repository at this point in the history
update class path for job URL
  • Loading branch information
whitej6 authored Jan 8, 2024
2 parents 7c1e216 + 0656a74 commit 28ed409
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
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>

0 comments on commit 28ed409

Please sign in to comment.