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

extmods: add utils directories in sys.path #52001

Merged
merged 1 commit into from
Mar 22, 2019

Conversation

aplanas
Copy link
Contributor

@aplanas aplanas commented Mar 6, 2019

What does this PR do?

When the minion start clean and there are not utils directory in
the extmods cache, any import from a module to any code inside the
utils directory will fail. A second run of the highstate will fix
this issue, as the utils directories are added into sys.path inside
config/init.py, as part of the master and minion startup.

This commit add the utils directories during the synchronization of
the custom modules.

Fixes #51958

aplanas added a commit to aplanas/salt-1 that referenced this pull request Mar 6, 2019
* Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg)
  saltstack/salt#50125

* Add root parameter to useradd, shadow and groupadd
  saltstack/salt#50175

* cmd: Add root parameter for wait and run states
  saltstack/salt#50302

* systemd: add optional root parameter
  saltstack/salt#50380

* Add new chroot module
  https://github.com/openSUSE/salt/pull/50418

* Add new module freezer
  saltstack/salt#50452

* btrfs: add all subvolume commands
  saltstack/salt#50541

* btrfs: add new btrfs state
  saltstack/salt#50635

* zypper: demote log from error to warning
  saltstack/salt#50671

* blkid: add search by token
  saltstack/salt#50706

* mount: add fstab_{present,absent} states
  saltstack/salt#50725

* btrfs: add option to not set subvolumes as default
  saltstack/salt#50801

* Add disk_set and disk_toggle functions, and update valid partition flags
  saltstack/salt#50834

* disk: support setting FAT size for format_
  saltstack/salt#51074

* parted: fix set_ valid flags comment.
  saltstack/salt#51704

* grains/core: ignore HOST_NOT_FOUND errno in fqdns()
  saltstack/salt#51706

* cmdmod: add 'binds' parameter in run_chroot
  saltstack/salt#51871

* mount: fix extra -t parameter
  saltstack/salt#51905

* lvm: be quiet when a pv, lv or vg is not expected
  saltstack/salt#51929

* linux_lvm: clean error in pvcreate and pvremove
  saltstack/salt#51954

* blockdev: hide blkid errors when are expected
  saltstack/salt#51956

* partially unify public functions signature for pkg and lowpkg
  saltstack/salt#51973

* extmods: add utils directories in sys.path
  saltstack/salt#52001
@twangboy
Copy link
Contributor

twangboy commented Mar 6, 2019

@thatch @dwoz Will this affect the loader?

@dwoz dwoz requested review from dwoz and thatch45 March 7, 2019 17:04
@aplanas aplanas force-pushed the fix_sync branch 2 times, most recently from 9da8c4d to df0af9e Compare March 12, 2019 09:49
@aplanas
Copy link
Contributor Author

aplanas commented Mar 14, 2019

I tested this code for a week and I didn't find any problem with the loader. I am only tenting it in Linux.

@thatch45
Copy link
Contributor

@aplanas logic is sound. This should be good to merge

When the minion start clean and there are not utils directory in
the extmods cache, any import from a module to any code inside the
utils directory will fail. A second run of the highstate will fix
this issue, as the utils directories are added into sys.path inside
config/__init__.py, as part of the master and minion startup.

This commit add the utils directories during the synchronization of
the custom modules.

Fixes saltstack#51958
@garethgreenaway garethgreenaway merged commit a6c13c6 into saltstack:develop Mar 22, 2019
@aplanas aplanas deleted the fix_sync branch March 25, 2019 13:14
aplanas added a commit to aplanas/salt-1 that referenced this pull request Jun 5, 2019
* Add root and no_recommends parameters in the public interface for Zypper and RPM (lowpkg)
  saltstack/salt#50125

* Add root parameter to useradd, shadow and groupadd
  saltstack/salt#50175

* cmd: Add root parameter for wait and run states
  saltstack/salt#50302

* systemd: add optional root parameter
  saltstack/salt#50380

* Add new chroot module
  https://github.com/openSUSE/salt/pull/50418

* Add new module freezer
  saltstack/salt#50452

* btrfs: add all subvolume commands
  saltstack/salt#50541

* btrfs: add new btrfs state
  saltstack/salt#50635

* zypper: demote log from error to warning
  saltstack/salt#50671

* blkid: add search by token
  saltstack/salt#50706

* mount: add fstab_{present,absent} states
  saltstack/salt#50725

* btrfs: add option to not set subvolumes as default
  saltstack/salt#50801

* Add disk_set and disk_toggle functions, and update valid partition flags
  saltstack/salt#50834

* disk: support setting FAT size for format_
  saltstack/salt#51074

* parted: fix set_ valid flags comment.
  saltstack/salt#51704

* grains/core: ignore HOST_NOT_FOUND errno in fqdns()
  saltstack/salt#51706

* cmdmod: add 'binds' parameter in run_chroot
  saltstack/salt#51871

* mount: fix extra -t parameter
  saltstack/salt#51905

* lvm: be quiet when a pv, lv or vg is not expected
  saltstack/salt#51929

* linux_lvm: clean error in pvcreate and pvremove
  saltstack/salt#51954

* blockdev: hide blkid errors when are expected
  saltstack/salt#51956

* partially unify public functions signature for pkg and lowpkg
  saltstack/salt#51973

* extmods: add utils directories in sys.path
  saltstack/salt#52001
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Sep 19, 2019
@alexey-zhukovin alexey-zhukovin added the has master-port port to master has been created label Apr 22, 2020
waynew added a commit to alexey-zhukovin/salt that referenced this pull request Feb 23, 2021
According to saltstack#52001 we need to add the mod_dir to sys.path if we have
any `utils_dirs`. These tests ensure that happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-jam has master-port port to master has been created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extmods/utils is not in sys.path after synchronizing _utils directory
6 participants