Skip to content

Conversation

@dimaqq
Copy link
Contributor

@dimaqq dimaqq commented May 21, 2025

Description

#1044 fixed proxy object reuse some time ago
I accidentally undid that change in #1186 as I didn't realise that multiple connect/close calls were expected on a given instance.
This PR re-applies the change, and cleans up init.

(I've rearranged the initialisation order, because __del__() is run on a partially-initialised instance if __init__() fails half-way through. That's something that happens in unit tests, although unlikely to affect legitimate use.)

Fixes: #1264 creating offer fails when connecting to existing model

QA Steps

  • No regression in unit or integration tests
  • Eyeball the code change

All CI tests need to pass.

Fixes #1264

@dimaqq
Copy link
Contributor Author

dimaqq commented May 21, 2025

Nevermind all integration tests failing, that's the case in the main branch too: https://github.com/juju/python-libjuju/commits/main/

@dimaqq dimaqq requested a review from benhoyt May 21, 2025 02:04
@dimaqq
Copy link
Contributor Author

dimaqq commented May 21, 2025

Asking @benhoyt to review while @james-garner-canonical is away.

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

This looks good to me. Couple of nit comments. Let's just ensure we've tested this code path in real life (manually is okay).

@dimaqq
Copy link
Contributor Author

dimaqq commented May 21, 2025

I've merged #1268 into this PR.

@dimaqq dimaqq requested a review from benhoyt May 21, 2025 09:51
@dimaqq dimaqq requested a review from gfouillet May 21, 2025 23:46
Copy link

@gfouillet gfouillet left a comment

Choose a reason for hiding this comment

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

That's cleaner, LGTM.

@dimaqq
Copy link
Contributor Author

dimaqq commented May 22, 2025

/build

@dimaqq
Copy link
Contributor Author

dimaqq commented May 22, 2025

I've confirmed that the fix works manually.

@dimaqq
Copy link
Contributor Author

dimaqq commented May 22, 2025

/merge

@dimaqq
Copy link
Contributor Author

dimaqq commented May 22, 2025

/build

@dimaqq
Copy link
Contributor Author

dimaqq commented May 23, 2025

/merge

@jujubot jujubot merged commit 8098519 into juju:main May 23, 2025
22 of 29 checks passed
@dimaqq dimaqq deleted the fix-creating-offer-when-connecting-to-existing-model branch May 23, 2025 01:00
@dimaqq dimaqq mentioned this pull request May 23, 2025
jujubot added a commit that referenced this pull request May 25, 2025
#1271

#### Description

PR to release python-libjuju 3.6.1.2


Runtime fixes:
- #1265 

Typing fixes:
- #1258

Chores & CI:
- #1268
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.

Creating offer fails when connecting to already existing model

4 participants