From b614ba6e5579b048413a19d4c4861207c95fe606 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Tue, 30 Jan 2024 16:25:17 -0500 Subject: [PATCH] Remove expire date information from AnsibleTower This isn't really used anymore. If this is brought back in the future, it would likely best be introduced as a new fact instead of separate attribute on the host. --- broker/providers/ansible_tower.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/broker/providers/ansible_tower.py b/broker/providers/ansible_tower.py index 2572a2cd..d439cf64 100644 --- a/broker/providers/ansible_tower.py +++ b/broker/providers/ansible_tower.py @@ -344,15 +344,6 @@ def _get_failure_messages(self, workflow): else: return failure_messages - def _get_expire_date(self, host_id): - try: - time_stamp = ( - self.v2.hosts.get(id=host_id).results[0].related.ansible_facts.get().expire_date - ) - return str(datetime.fromtimestamp(int(time_stamp))) - except AttributeError: - logger.debug(f"Unable to find expire_date for host {host_id}") - def _compile_host_info(self, host): # attempt to get the hostname from the host variables and then facts if not (hostname := host.variables.get("fqdn")): @@ -368,9 +359,6 @@ def _compile_host_info(self, host): "_broker_provider_instance": self.instance, "_broker_args": getattr(host, "_broker_args", {}), } - expire_time = self._get_expire_date(host.id) - if expire_time: - host_info["expire_time"] = expire_time try: create_job = self.v2.jobs.get(id=host.get_related("job_events").results[0].job) create_job = create_job.results[0].get_related("source_workflow_job")