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

Remove expire date information from AnsibleTower #262

Merged
merged 1 commit into from
Jan 31, 2024
Merged
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
12 changes: 0 additions & 12 deletions broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")):
Expand All @@ -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")
Expand Down
Loading