From 8ffee5cd99aca0c37a676141475c740fe5c15a7e Mon Sep 17 00:00:00 2001 From: Nate Reeves Date: Tue, 24 Sep 2024 14:07:10 +0000 Subject: [PATCH] Changed last_contract_date to reflect EndOfSvcAttachDate instead of EndOfServiceContractRenewal --- .../management/commands/sync_cisco_hw_eox_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/netbox_lifecycle/management/commands/sync_cisco_hw_eox_data.py b/netbox_lifecycle/management/commands/sync_cisco_hw_eox_data.py index 635ec0f..a2f7d5d 100644 --- a/netbox_lifecycle/management/commands/sync_cisco_hw_eox_data.py +++ b/netbox_lifecycle/management/commands/sync_cisco_hw_eox_data.py @@ -133,18 +133,18 @@ def update_lifecycle_data(self, pid, hardware_type, eox_data): self.stdout.write(self.style.NOTICE(f"{pid} - has no end_of_security_vul_support_date")) try: - if not eox_data["EOXRecord"][0]["EndOfServiceContractRenewal"]["value"]: - self.stdout.write(self.style.NOTICE(f"{pid} - has no end_of_service_contract_renewal")) + if not eox_data["EOXRecord"][0]["EndOfSvcAttachDate"]["value"]: + self.stdout.write(self.style.NOTICE(f"{pid} - has no end_of_service_attach_date")) else: - last_contract_date_string = eox_data["EOXRecord"][0]["EndOfServiceContractRenewal"]["value"] + last_contract_date_string = eox_data["EOXRecord"][0]["EndOfSvcAttachDate"]["value"] last_contract_date_date = datetime.strptime(last_contract_date_string, '%Y-%m-%d').date() - self.stdout.write(self.style.SUCCESS(f"{pid} - end_of_service_contract_renewal: {last_contract_date_date}")) + self.stdout.write(self.style.SUCCESS(f"{pid} - end_of_service_attach_date: {last_contract_date_date}")) if hw_lifecycle.last_contract_date != last_contract_date_date: hw_lifecycle.last_contract_date = last_contract_date_date value_changed = True except KeyError: - self.stdout.write(self.style.NOTICE(f"{pid} - has no end_of_service_contract_renewal")) + self.stdout.write(self.style.NOTICE(f"{pid} - has no end_of_service_attach_date")) try: if not eox_data["EOXRecord"][0]["LastDateOfSupport"]["value"]: