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

modules imported from other salt modules fail (tested on Windows) #9060

Closed
UtahDave opened this issue Dec 5, 2013 · 2 comments · Fixed by #9062
Closed

modules imported from other salt modules fail (tested on Windows) #9060

UtahDave opened this issue Dec 5, 2013 · 2 comments · Fixed by #9062
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around

Comments

@UtahDave
Copy link
Contributor

UtahDave commented Dec 5, 2013

salt/modules/win_file.py imports several functions from salt/modules/file.py that are platform independent. This has apparently broken on the latest from git develop branch. If I copy the "file_exists()" function from file.py manually into win_file.py, then it works just fine. So it's not the function itself, but something to do with the import into the current namespace.

root@boucha:~# salt 'Win*' file.file_exists 'c:\\my_file.txt'
Win64-BuildServer-v3:
    The minion function caused an exception: Traceback (most recent call last):
      File "c:\python27\lib\site-packages\salt\minion.py", line 731, in _thread_return
        sys.modules[func.__module__].__context__['retcode'] = 0
    AttributeError: 'module' object has no attribute '__context__'

root@boucha:~# salt 'Win*' test.versions_report
Win64-BuildServer-v3:
               Salt: 0.17.0-5403-g6cd183b
             Python: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
             Jinja2: 2.7.1
           M2Crypto: 0.21.1
     msgpack-python: 0.3.0
       msgpack-pure: Not Installed
           pycrypto: 2.6
             PyYAML: 3.10
              PyZMQ: 13.1.0
                ZMQ: 3.2.2

@s0undt3ch
Copy link
Member

Is that function namespaced?

@UtahDave
Copy link
Contributor Author

UtahDave commented Dec 5, 2013

Ah, I can fix this now. Thanks, @s0undt3ch. I'll have a pull req shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants