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

[master] Use salt-call from salt bundle with transactional_update #65204

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vzhestkov
Copy link
Contributor

What does this PR do?

What issues does this PR fix or reference?

In some cases if both salt bundle and classic salt package installed on the same system, transactional_update module can wrongly execute salt-call of classic salt packge instead of salt bundle which was used to process the event.

Previous Behavior

Wrong salt-call executed inside the transaction while using transactional_update.

New Behavior

In case if the event processed with salt from the bundle transactional_update will call salt-call from the bundle explicitly.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@vzhestkov vzhestkov requested a review from a team as a code owner September 15, 2023 11:31
@vzhestkov vzhestkov requested review from Ch3LL and removed request for a team September 15, 2023 11:31
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Use salt-call from salt bundle with transactional_update [master] Use salt-call from salt bundle with transactional_update Sep 15, 2023
@vzhestkov vzhestkov force-pushed the use-salt-call-from-salt-bundle-with-transactional_update branch from 422ef4f to 05be8e2 Compare September 15, 2023 11:45
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:01 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:01 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:01 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:01 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:20 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 12:24 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:31 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:43 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:43 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:43 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:43 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:43 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 15, 2023 13:44 — with GitHub Actions Inactive
@vzhestkov vzhestkov force-pushed the use-salt-call-from-salt-bundle-with-transactional_update branch from 05be8e2 to f6e54bc Compare September 18, 2023 07:16
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 07:33 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 07:33 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 07:33 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 07:56 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:48 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:48 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:48 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:48 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:48 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 08:49 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
@vzhestkov vzhestkov temporarily deployed to ci September 18, 2023 09:00 — with GitHub Actions Inactive
Copy link
Contributor

@meaksh meaksh left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks

Comment on lines +947 to +953
# Set default salt-call command
salt_call_cmd = "salt-call"
python_exec_dir = os.path.dirname(sys.executable)
if "venv-salt-minion" in pathlib.Path(python_exec_dir).parts:
# If the module is executed with the Salt Bundle,
# use salt-call from the Salt Bundle
salt_call_cmd = os.path.join(python_exec_dir, "salt-call")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it needed to do the path juggling inside Python code, can't we prepend the "Salt Bundle" bin/ directory to $PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can do it with PATH outside, but actually I think to do it this way is more raliable as it's more strict and in case of handling transactional_update with salt-ssh it will push us to make the external solution more conditional

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.

4 participants