Skip to content

Wire up _client reference for Job.status() to poll disconnect jobs#19

Open
Arittra-Bag wants to merge 1 commit into
mainfrom
ssh-fix
Open

Wire up _client reference for Job.status() to poll disconnect jobs#19
Arittra-Bag wants to merge 1 commit into
mainfrom
ssh-fix

Conversation

@Arittra-Bag
Copy link
Copy Markdown
Collaborator

Fix Job.status() failure for SSH disconnect jobs

SSHClient.disconnect_all_users() returns a Job and assigns job._client = self._client so the job can later fetch status. However, AtomicClient.__init__ only initialized the client reference for sites, leaving ssh._client unset.

As a result, SSH disconnect jobs were created with a None client reference, causing Job.status() to raise:

RuntimeError: Job object must be initialized with a client reference to fetch status.

This change wires self.ssh._client = self during AtomicClient initialization, matching the existing sites setup and allowing SSH disconnect jobs to fetch their status correctly.

Copilot AI review requested due to automatic review settings May 6, 2026 13:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes polling for asynchronous SSH “disconnect all users” jobs by ensuring Job instances created by SSHClient have a valid AtomicClient reference, allowing Job.status() to call into sites.get_job_status() as intended.

Changes:

  • Update AtomicClient.__init__ to attach the main client reference to ssh (self.ssh._client = self), matching the existing sites wiring.
  • Generalize the inline comment to reflect that multiple resource clients may return Job objects requiring a client reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Arittra-Bag Arittra-Bag requested a review from mrrobot47 May 8, 2026 16:30
@Arittra-Bag Arittra-Bag self-assigned this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants