Skip to content

Commit

Permalink
Switch ssh-python dependency from PyPi to github fork
Browse files Browse the repository at this point in the history
ssh2-python on PyPi is stale, so switching to my fork should give us
back our python 3.12 compatability.

I also updated a couple of exception catches based on user feedback.
  • Loading branch information
JacobCallahan committed Jan 11, 2024
1 parent ea5187b commit 81fc523
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ def _get_expire_date(self, host_id):
self.v2.hosts.get(id=host_id).results[0].related.ansible_facts.get().expire_date
)
return str(datetime.fromtimestamp(int(time_stamp)))
except Exception as err: # noqa: BLE001
logger.debug(f"Tell Jake that the exception here is: {err}!")
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
Expand All @@ -375,7 +375,7 @@ def _compile_host_info(self, host):
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")
host_info["_broker_args"]["workflow"] = create_job.name
except IndexError:
except (IndexError, awxkit.exceptions.Unknown): # Unknown is a Gateway Timeout
if "last_job" in host.related:
# potentially not create job, but easier processing below
create_job = host.get_related("last_job")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"packaging",
"pyyaml",
"setuptools",
"ssh2-python",
"ssh2-python@git+https://github.com/jacobcallahan/ssh2-python.git"
]
dynamic = ["version"] # dynamic fields to update on build - version via setuptools_scm

Expand Down

0 comments on commit 81fc523

Please sign in to comment.