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

saltutil.sync_utils does not work for the salt.utils.templates module? #51719

arizvisa opened this issue Feb 19, 2019 · 4 comments
Question The issue is more of a question rather than a bug or a feature request


Copy link

Description of Issue/Question

I wrote a PR (#51718) to fix the support of the Cheetah engine in salt.utils.templates, and I'm trying to synchronize my fix to each minion via saltutil.sync_all or saltutil.sync_utils (until you guys merge it or whatever). However, for some reason salt-minion is still picking up the path via salt.utils.templates (in site-packages/salt) instead of honoring the module in the extmods cache. Is this unsupported for certain modules, or is it just a version issue on my end?


Write to _utils under your salt base environment so that when you call saltutil.sync_utils, it'll cache it under extmods. Just to be sure, you can rm the salt/utils/ file from your site-packages on the target minion. This should normally be okay because salt-minion should pick up the module that is cached in extmods.

Steps to Reproduce Issue

Run salt $target saltutil.sync_utils to confirm the module gets synchronized. However, note that salt-minion will still use the old salt.utils.templates module, or complain that it is unable to locate the module via an ImportError.

Versions Report

Salt Version:
           Salt: 2018.3.3

Dependency Versions:
           cffi: 1.10.0
       cherrypy: 10.2.1
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.5
      gitpython: 2.1.3
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: 1.6.1
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.17
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.3
           RAET: Not Installed
          smmap: 2.0.5
        timelib: 0.2.4
        Tornado: 4.5.1
            ZMQ: 4.1.6

System Versions:
         locale: cp1252
        machine: AMD64
        release: 8
         system: Windows
        version: 8 6.2.9200 SP0 Multiprocessor Free
Copy link

dwoz commented Feb 20, 2019

@arizvisa overriding utils modules via the extension_modules setting can be hit or miss depending on how the utils module is imported where it is being used.

@dwoz dwoz added the Question The issue is more of a question rather than a bug or a feature request label Feb 20, 2019
@dwoz dwoz added this to the Approved milestone Feb 20, 2019
Copy link
Contributor Author

gotcha, in that case the salt.utils.template is not using the loader, and so it's hard to hotpatch #51718.

Copy link
Contributor Author

but i have a workaround. if this isn't something you guys plan on changing, we can close this issue.

Copy link
Contributor Author

Closing this issue as it appears that it's not something you guys plan on changing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Question The issue is more of a question rather than a bug or a feature request
None yet

No branches or pull requests

2 participants