Skip to content

Commit

Permalink
Merge pull request #52001 from aplanas/fix_sync
Browse files Browse the repository at this point in the history
extmods: add utils directories in sys.path
  • Loading branch information
garethgreenaway authored Mar 22, 2019
2 parents be3c96e + 7e82f3e commit a6c13c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions salt/utils/extmods.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import logging
import os
import shutil
import sys

# Import salt libs
import salt.fileclient
Expand Down Expand Up @@ -131,6 +132,12 @@ def sync(opts,
shutil.copyfile(fn_, dest)
ret.append('{0}.{1}'.format(form, relname))

# If the synchronized module is an utils
# directory, we add it to sys.path
for util_dir in opts['utils_dirs']:
if mod_dir.endswith(util_dir) and mod_dir not in sys.path:
sys.path.append(mod_dir)

touched = bool(ret)
if opts['clean_dynamic_modules'] is True:
current = set(_listdir_recursively(mod_dir))
Expand Down

0 comments on commit a6c13c6

Please sign in to comment.