Skip to content

Commit

Permalink
fix: ssh_connection -> conn
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartz committed May 30, 2024
1 parent 29e3cf1 commit c4ad5d6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/openstack_cloud/openstack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ def reconcile(self, quantity: int) -> int:

end_ts = time.time()
self._issue_reconciliation_metrics(
ssh_connection=conn, reconciliation_start_ts=start_ts, reconciliation_end_ts=end_ts
conn=conn, reconciliation_start_ts=start_ts, reconciliation_end_ts=end_ts
)

return delta
Expand Down Expand Up @@ -1482,7 +1482,7 @@ def _issue_runner_installed_metric(

def _issue_reconciliation_metrics(
self,
ssh_connection: SshConnection,
conn: OpenstackConnection,
reconciliation_start_ts: float,
reconciliation_end_ts: float,
) -> None:
Expand All @@ -1491,33 +1491,33 @@ def _issue_reconciliation_metrics(
This includes the metrics for the runners and the reconciliation metric itself.
Args:
ssh_connection: The SSH connection to the runner instance.
conn: The connection object to access OpenStack cloud.
reconciliation_start_ts: The timestamp of when reconciliation started.
reconciliation_end_ts: The timestamp of when reconciliation ended.
"""
runner_states = self._get_openstack_runner_status(ssh_connection)
runner_states = self._get_openstack_runner_status(conn)

metric_stats = self._issue_runner_metrics(ssh_connection)
metric_stats = self._issue_runner_metrics(conn)
self._issue_reconciliation_metric(
metric_stats=metric_stats,
reconciliation_start_ts=reconciliation_start_ts,
reconciliation_end_ts=reconciliation_end_ts,
runner_states=runner_states,
)

def _issue_runner_metrics(self, ssh_conn: SshConnection) -> IssuedMetricEventsStats:
def _issue_runner_metrics(self, conn: OpenstackConnection) -> IssuedMetricEventsStats:
"""Issue runner metrics.
Args:
ssh_conn: SSH connection to the runner instance.
conn: The connection object to access OpenStack cloud.
Returns:
The stats of issued metric events.
"""
total_stats: IssuedMetricEventsStats = {}

try:
openstack_instances = self._get_openstack_instances(ssh_conn)
openstack_instances = self._get_openstack_instances(conn)
except openstack.exceptions.SDKException:
logger.exception(
"Failed to get openstack instances to ignore when extracting metrics."
Expand Down

0 comments on commit c4ad5d6

Please sign in to comment.