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

Add a mechanism to swap nailgun versions on demand #12840

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

JacobCallahan
Copy link
Member

@JacobCallahan JacobCallahan commented Oct 6, 2023

Satellite._swap_nailgun("x.y.z") can be used to change out the operating version of nailgun.

This actually changes out the installed version of nailgun on the fly, so this should only be used in upgrades.

Satellite._swap_nailgun("x.y.z") can be used to change out the operating
version of nailgun.
@JacobCallahan JacobCallahan added enhancement An addition to the robottelo framework Upgrades Issues and PRs related to upgrades Framework Changes A modification of the robottelo framework CherryPick PR needs CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 labels Oct 6, 2023
@JacobCallahan JacobCallahan requested a review from a team as a code owner October 6, 2023 17:41
Copy link
Member

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

Some comments and Questions !

Comment on lines +1764 to +1765
to_clear = [k for k in sys.modules.keys() if 'nailgun' in k]
[sys.modules.pop(k) for k in to_clear]
Copy link
Member

Choose a reason for hiding this comment

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

Does this clearance should be done after uninstalling the previous Nailgun version and before installing new nailgun version ?

Copy link
Member

Choose a reason for hiding this comment

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

This implementation would likely cleanup the bits of newly installed nailgun as well hence above comment, correct me if I am wrong .

Copy link
Member Author

Choose a reason for hiding this comment

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

the order here is less important than you might think. the current modules are live in memory, so this only really helps for new imports (like what we do when recreating the Satellite.api attributes.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting how popping out the nailgun specific modules from sys.modules would still make nailgun module available.

Do you mean the newly installed nailgun isnt the part of sys.modules and only unistalled is ?

robottelo/hosts.py Show resolved Hide resolved
robottelo/hosts.py Show resolved Hide resolved
Copy link
Member

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

ACK pending questions/doubts!

Comment on lines +1764 to +1765
to_clear = [k for k in sys.modules.keys() if 'nailgun' in k]
[sys.modules.pop(k) for k in to_clear]
Copy link
Member

Choose a reason for hiding this comment

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

Interesting how popping out the nailgun specific modules from sys.modules would still make nailgun module available.

Do you mean the newly installed nailgun isnt the part of sys.modules and only unistalled is ?

robottelo/hosts.py Show resolved Hide resolved
@JacobCallahan
Copy link
Member Author

@jyejare re:

"Do you mean the newly installed nailgun isnt the part of sys.modules and only unistalled is ?"

Until a module is loaded via an import statement, it won't be added to sys.modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 CherryPick PR needs CherryPick to previous branches enhancement An addition to the robottelo framework Framework Changes A modification of the robottelo framework Upgrades Issues and PRs related to upgrades
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants