ipfabric_netbox 4.3.0b8__py3-none-any.whl → 4.3.0b10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ipfabric_netbox might be problematic. Click here for more details.

@@ -6,7 +6,7 @@ class NetboxIPFabricConfig(PluginConfig):
6
6
  name = "ipfabric_netbox"
7
7
  verbose_name = "NetBox IP Fabric SoT Plugin"
8
8
  description = "Sync IP Fabric into NetBox"
9
- version = "4.3.0b8"
9
+ version = "4.3.0b10"
10
10
  base_url = "ipfabric"
11
11
  min_version = "4.4.0"
12
12
 
ipfabric_netbox/models.py CHANGED
@@ -897,7 +897,7 @@ class IPFabricSync(IPFabricClient, JobsMixin, TagsMixin, ChangeLoggedModel):
897
897
  self.logger.log_info("Auto Merging Ingestion", obj=ingestion)
898
898
  logger.info("Auto Merging Ingestion")
899
899
  try:
900
- ingestion.enqueue_merge_job(user=user)
900
+ ingestion.enqueue_merge_job(user=user, remove_branch=True)
901
901
  self.logger.log_info("Auto Merge Job Enqueued", obj=ingestion)
902
902
  logger.info("Auto Merge Job Enqueued")
903
903
  except NameError:
@@ -962,6 +962,9 @@ class IPFabricIngestion(JobsMixin, models.Model):
962
962
  )
963
963
 
964
964
  def get_logs(self):
965
+ if not self.job:
966
+ # The Job is deleted by manual action
967
+ return {}
965
968
  if self.job.data:
966
969
  job_results = self.job.data
967
970
  else:
@@ -15,7 +15,7 @@
15
15
  {% custom_links object %}
16
16
  </div>
17
17
  {% if perms.core.sync_datasource %}
18
- {% if object.sync.ready_for_sync %}
18
+ {% if object.sync.ready_for_sync and object.branch and object.branch.status != "merged" %}
19
19
  <a href="#"
20
20
  hx-get="{% url 'plugins:ipfabric_netbox:ipfabricingestion_merge' pk=object.pk %}"
21
21
  hx-target="#htmx-modal-content"
@@ -69,7 +69,7 @@
69
69
  </tr>
70
70
  <tr>
71
71
  <th scope="row">Job Object</th>
72
- <td><a href="{% url 'core:job' pk=object.job.pk %}">{{ object.job }}</a></td>
72
+ <td>{% if object.job %}<a href="{% url 'core:job' pk=object.job.pk %}">{{ object.job }}</a>{% else %}{{ ""|placeholder }}{% endif %}</td>
73
73
  </tr>
74
74
  <tr>
75
75
  <th scope="row">Ingestion Status</th>
@@ -96,14 +96,14 @@
96
96
  {% include 'ipfabric_netbox/partials/ingestion_statistics.html' with object=object %}
97
97
  </div>
98
98
  <div id="ingestion_progress" hx-swap-oob="true">
99
- {% include 'ipfabric_netbox/partials/ingestion_progress.html' %}
99
+ {% include 'ipfabric_netbox/partials/ingestion_progress.html' with job=object.job %}
100
100
  </div>
101
101
  <!-- {% include 'inc/panels/related_objects.html' %} -->
102
102
  {% include 'inc/panels/custom_fields.html' %}
103
103
  {% plugin_right_page object %}
104
104
  </div>
105
105
  <div class="row mb-3">
106
- <div class="col col-md-12" {% if not object.job.completed %} hx-get="{% url 'plugins:ipfabric_netbox:ipfabricingestion_logs' pk=object.pk %}?type=info"
106
+ <div class="col col-md-12" {% if object.job and not object.job.completed %} hx-get="{% url 'plugins:ipfabric_netbox:ipfabricingestion_logs' pk=object.pk %}?type=info"
107
107
  hx-trigger="every 5s" hx-target="#ingestion_logs" hx-select="#ingestion_logs" hx-select-oob="#ingestion_status:innerHTML,#ingestion_progress:innerHTML,#ingestion_statistics:innerHTML,#object_tabs:innerHTML"
108
108
  hx-swap="innerHTML" {% endif %}>
109
109
  <div id="ingestion_logs">{% include 'ipfabric_netbox/partials/job_logs.html' with job=object.job %}</div>
@@ -8,7 +8,7 @@
8
8
  {% include 'ipfabric_netbox/partials/ingestion_status.html' with object=object %}
9
9
  </div>
10
10
  <div id="ingestion_progress" hx-swap-oob="true">
11
- {% include 'ipfabric_netbox/partials/ingestion_progress.html' %}
11
+ {% include 'ipfabric_netbox/partials/ingestion_progress.html' with job=job %}
12
12
  </div>
13
13
  <div id="ingestion_logs">
14
14
  {% include 'ipfabric_netbox/partials/job_logs.html' with job_results=job_results job=job %}
@@ -2,7 +2,9 @@
2
2
  <div class="card">
3
3
  <h5 class="card-header">Progress</h5>
4
4
  <div class="card-body">
5
- {% if statistics %}
5
+ {% if not job %}
6
+ Cannot show progress, no sync Job exists anymore.
7
+ {% elif statistics %}
6
8
  <table class="table table-hover attr-table">
7
9
  {% for model, util in statistics.items %}
8
10
  <tr>
@@ -2,20 +2,20 @@
2
2
  {% load helpers %}
3
3
 
4
4
  <p>
5
- {% if job.started %}
6
- Started: <strong>{{ job.started|isodatetime }}</strong>
7
- {% elif job.scheduled %}
8
- Scheduled for: <strong>{{ job.scheduled|isodatetime }}</strong> ({{ job.scheduled|naturaltime }})
9
- {% else %}
10
- Created: <strong>{{ job.created|isodatetime }}</strong>
11
- {% endif %}
12
- {% if job.completed %}
13
- Duration: <strong>{{ job.duration }}</strong>
14
- {% endif %}
5
+ {% if job.started %}
6
+ Started: <strong>{{ job.started|isodatetime }}</strong>
7
+ {% elif job.scheduled %}
8
+ Scheduled for: <strong>{{ job.scheduled|isodatetime }}</strong> ({{ job.scheduled|naturaltime }})
9
+ {% elif job %}
10
+ Created: <strong>{{ job.created|isodatetime }}</strong>
11
+ {% endif %}
12
+ {% if job.completed %}
13
+ Duration: <strong>{{ job.duration }}</strong>
14
+ {% endif %}
15
15
  <span id="pending-result-label">{% badge job.get_status_display job.get_status_color %}</span>
16
16
  </p>
17
- {% if not job.completed %}
18
- {% include 'ipfabric_netbox/inc/logs_pending.html' %}
17
+ {% if job and not job.completed %}
18
+ {% include 'ipfabric_netbox/inc/logs_pending.html' %}
19
19
  {% endif %}
20
20
  <div class="card">
21
21
  <h5 class="card-header">Sync Results</h5>
@@ -1628,7 +1628,7 @@ class IPFabricIngestionTestCase(
1628
1628
  self.assertHttpStatus(response, 200)
1629
1629
 
1630
1630
  # Verify the response contains expected elements
1631
- self.assertContains(response, "Logs pending...")
1631
+ self.assertContains(response, "Ingestion progress pending...")
1632
1632
 
1633
1633
  @override_settings(EXEMPT_VIEW_PERMISSIONS=["*"])
1634
1634
  def test_get_logs_htmx(self):
ipfabric_netbox/views.py CHANGED
@@ -938,7 +938,7 @@ class IPFabricIngestionLogView(LoginRequiredMixin, View):
938
938
  ingestion = annotate_statistics(IPFabricIngestion.objects).get(pk=ingestion_id)
939
939
  data = ingestion.get_statistics()
940
940
  data["object"] = ingestion
941
- data["job"] = ingestion.jobs.first()
941
+ data["job"] = ingestion.job
942
942
 
943
943
  if request.htmx:
944
944
  response = render(
@@ -946,7 +946,7 @@ class IPFabricIngestionLogView(LoginRequiredMixin, View):
946
946
  self.template_name,
947
947
  data,
948
948
  )
949
- if ingestion.job.completed:
949
+ if not ingestion.job or ingestion.job.completed:
950
950
  response["HX-Refresh"] = "true"
951
951
  return response
952
952
  return render(request, self.template_name, data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipfabric_netbox
3
- Version: 4.3.0b8
3
+ Version: 4.3.0b10
4
4
  Summary: NetBox plugin to sync IP Fabric data into NetBox
5
5
  License: MIT
6
6
  Keywords: netbox,ipfabric,plugin,sync
@@ -1,4 +1,4 @@
1
- ipfabric_netbox/__init__.py,sha256=OTnSDhJRsShw8su9ERPqVv7GzWob31Rb6yfngwD91Mo,674
1
+ ipfabric_netbox/__init__.py,sha256=r-JYuPdUq2wAFRTF2HozJNO6cLsDYNYXtaxfMf8xlhg,675
2
2
  ipfabric_netbox/api/__init__.py,sha256=XRclTGWVR0ZhAAwgYul5Wm_loug5_hUjEumbLQEwKYM,47
3
3
  ipfabric_netbox/api/serializers.py,sha256=lr_PWG0tqAxaKtkIIm8Gx2B-tn9yENQIfKY9cvu8Cco,6581
4
4
  ipfabric_netbox/api/urls.py,sha256=1fXXVTxNY5E64Nfz6b7zXD9bZI3FcefuxAWKMe0w_QU,1240
@@ -36,7 +36,7 @@ ipfabric_netbox/migrations/0018_remove_type_field.py,sha256=ffxW6IS3BLCbvM5M9DbD
36
36
  ipfabric_netbox/migrations/0019_alter_ipfabrictransformmap_options_and_more.py,sha256=ieDVedt9KpJBicAiC3kdZXzHeos12N0L9EdRXKmIVgY,501
37
37
  ipfabric_netbox/migrations/0020_clean_scheduled_jobs.py,sha256=zjCVKnCWTKYYkpVRwHjqRIRR2j6ALSKXYMfraRjNu7Y,2652
38
38
  ipfabric_netbox/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- ipfabric_netbox/models.py,sha256=PgcxznpcihHwkdWlBJN1q2YshyvYS3lKvDvgQVSSDbI,38105
39
+ ipfabric_netbox/models.py,sha256=g6EnrCp714aDig7Rh3_WRe1CHIwpSMV1YLWJexUJL2U,38222
40
40
  ipfabric_netbox/navigation.py,sha256=2dEJ_wKHb52Tl0FOV1TH3JbxRe8YZ56ewrTsBFGKpCg,2210
41
41
  ipfabric_netbox/signals.py,sha256=cGa5PVD2i24pGXiVNfbu6ruIDqPVdwKQHTSWe9Ura84,1838
42
42
  ipfabric_netbox/tables.py,sha256=BpPmL6-KClX16Ol_PIADyOx9NtDR9oauXH5iO4GeSoI,9008
@@ -52,7 +52,7 @@ ipfabric_netbox/templates/ipfabric_netbox/inc/snapshotdata.html,sha256=1ItOCPjjp
52
52
  ipfabric_netbox/templates/ipfabric_netbox/inc/transform_map_field_map.html,sha256=mRU-rBweVFvaPFHbVYPw7vcYyXiVaXCOkeHm7xWdKPA,500
53
53
  ipfabric_netbox/templates/ipfabric_netbox/inc/transform_map_relationship_map.html,sha256=qyuG_EXZMGUscA3sv_6WGSrf_bR7JTRlKyMYf6EYyo4,504
54
54
  ipfabric_netbox/templates/ipfabric_netbox/ipfabric_table.html,sha256=TsF34lK2CyDsMxlFTk--2lF_0AxYM614eKmkgYAbJ-k,1629
55
- ipfabric_netbox/templates/ipfabric_netbox/ipfabricingestion.html,sha256=fm_X2FLnoTS6s6AL3WmU6p3puDojROSkPG0jA4EBQeM,4435
55
+ ipfabric_netbox/templates/ipfabric_netbox/ipfabricingestion.html,sha256=ymqTB9JEk0AFncK5kz8yStHWCD_IMNKlbgyqu_qon7g,4585
56
56
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsnapshot.html,sha256=hj8ORs_4mM_xTjmw3McHN-da5seC8nbbkzobn0f1TSc,3482
57
57
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsource.html,sha256=DQOA2TA7f1nI5YpxXthS1VzjIU1kMZus37l6bYSCauE,3869
58
58
  ipfabric_netbox/templates/ipfabric_netbox/ipfabricsync.html,sha256=dt8HYuHCzIN4otLS9QK3e1aES14isFI-1jyp8jrENXU,4616
@@ -60,11 +60,11 @@ ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap.html,sha256=qFo_K
60
60
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap_list.html,sha256=p8zqn0-B6mawSUM3zQrus6dsKUM5SRBTO0X94pLboX8,452
61
61
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmap_restore.html,sha256=TV7gAZWtSd-c7mzOen_nv7Z8MZr2Vw8vkHP4zW9au4w,2580
62
62
  ipfabric_netbox/templates/ipfabric_netbox/ipfabrictransformmapgroup.html,sha256=H3uvjA4PdJq5uX2kizdHV1pAxwcPpyfc9IbJi1ZK5-k,975
63
- ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_all.html,sha256=W9W31m8b7mGrsfu0f_hE1TcudDqSJ0G2Bp9JE4UTIIE,662
64
- ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_progress.html,sha256=NellDFy1qzgVbCtkOZbiSi3ufau6FOLIQPUoNiU6Bg4,595
63
+ ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_all.html,sha256=ZstgG3MJbd8WAOcGUKEpt4CSjIInhF14wgVgqSc1oAs,675
64
+ ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_progress.html,sha256=tb9JAc9GjPd05F1RQdRrfrDwSQMWlcbbQOrQCXedQWs,680
65
65
  ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_statistics.html,sha256=_KtbxZQlIa_141OQSIAvSsMMfZRkNj27kJqrYHuLt7Y,867
66
66
  ipfabric_netbox/templates/ipfabric_netbox/partials/ingestion_status.html,sha256=qYXe-V-kQn1INqCHLSSpdrzXJ_IIt84AgCgAGwqpNbs,178
67
- ipfabric_netbox/templates/ipfabric_netbox/partials/job_logs.html,sha256=PMZxxrRVzn_JI8k5XCNV5BQnoFj9zYePN6afP6C_J2E,1622
67
+ ipfabric_netbox/templates/ipfabric_netbox/partials/job_logs.html,sha256=THiEs8wYMvEn8y0XGhxX7rj3w466CkDhaEzc4CxgGLY,1694
68
68
  ipfabric_netbox/templates/ipfabric_netbox/partials/object_tabs.html,sha256=3xbGy38Y1RH13bVPlcyj5L6J_FM-mOW1y0fx54hj1xE,364
69
69
  ipfabric_netbox/templates/ipfabric_netbox/partials/sync_last_ingestion.html,sha256=3v6tC88xE5cic9l9lQw7Msawoq-AW2oo2odd-osGv50,179
70
70
  ipfabric_netbox/templates/static/ipfabric_netbox/css/rack.css,sha256=z1H-RmmsqF2pGdhn5J64TMFiccy62xZUHHlCRd8fJrQ,118
@@ -75,14 +75,14 @@ ipfabric_netbox/tests/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
75
75
  ipfabric_netbox/tests/api/test_api.py,sha256=9o9k4kfnT3Zz9Hg0qnI0_XASt6pi5BCZQ3RhBjsb_iE,35215
76
76
  ipfabric_netbox/tests/test_forms.py,sha256=C8giV6E3PbMB9_864C12ebvfQ3Vlvdn39VIQQSP6GV8,61566
77
77
  ipfabric_netbox/tests/test_models.py,sha256=FFrIT5xxv_yvujKpxGjRJPNPBDF2Pqi8zbY0vxuJeQs,16043
78
- ipfabric_netbox/tests/test_views.py,sha256=pyUPdsgkvcfHC_BgmFtAQvENQfGvtEVSyNnRikLrlxc,87770
78
+ ipfabric_netbox/tests/test_views.py,sha256=OhPoRrXA8lEzjTktjbm3I8LkByBHDXA45z9gOEspho4,87784
79
79
  ipfabric_netbox/urls.py,sha256=qF2BzZEDnPRd3opFaRfiMdaarYKFfv69iMaAbU2rsBU,2702
80
80
  ipfabric_netbox/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  ipfabric_netbox/utilities/ipfutils.py,sha256=wFmL5oriuF-is1ZlrIcLmoeYUY5ih-CA9weRQrx5AiA,31885
82
82
  ipfabric_netbox/utilities/logging.py,sha256=GYknjocMN6LQ2873_az3y0RKm29TCXaWviUIIneH-x0,3445
83
83
  ipfabric_netbox/utilities/nbutils.py,sha256=kFBEiJOGvr_49hJWCS2duXojx2-A9kVk0Xp_vj0ohfs,2641
84
84
  ipfabric_netbox/utilities/transform_map.py,sha256=GpM_7Mm6FE0qV2qbyj4YfDn0l-JkeeEHQOZkNVSSHk4,2391
85
- ipfabric_netbox/views.py,sha256=n3tTDs1xOAY5xtcMmhM6VrnpEr-2IzqeliFNgthQf1U,44746
86
- ipfabric_netbox-4.3.0b8.dist-info/METADATA,sha256=A9F-rJ7Tl1pmXn__yVo7FfDRoZc1C03CWF8gv67JXzE,4754
87
- ipfabric_netbox-4.3.0b8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
- ipfabric_netbox-4.3.0b8.dist-info/RECORD,,
85
+ ipfabric_netbox/views.py,sha256=JcXvoLo8JQ0PUyvUwi1tZQgrxw9okKBlocsIUKoGAbo,44758
86
+ ipfabric_netbox-4.3.0b10.dist-info/METADATA,sha256=HmDqK34C2rPMsLnQF97Jl6AXYsREmhbdrkJaxntNrI8,4755
87
+ ipfabric_netbox-4.3.0b10.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
88
+ ipfabric_netbox-4.3.0b10.dist-info/RECORD,,