-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Python3 can't override core module #47395
Comments
this is working fine for me on the version report:
How are you installing python3? Maybe there is some conflicting pycache when installing between the two versions |
After some investigation the above indeed works. Thx:) Except if you try to override an existing function of test, it won't work with python3.5. Python2.7 will allow overriding. Can you confirm? |
Can you please respond to my question? We would really like to use python3. Thanks in advance. |
this also worked for me: Here is the test.py module i used:
and when I run it it returns
but i bet you are running into this issue: #46924 as a workaround if you clear your pycache after syncing the module does it work? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
We were investigating if we could take the step to python3. Our first tests were fine.
But we found a blocking issue. If we use a internal module, let's say network. We override one function, sync this to a minion. It wont be picked up. If we use python2.7 this works:
Python2.7
Example module:
/srv/salt/states/_modules
jurgen@jurgen-HP-ZBook-15u-G3:/srv/salt/states/_modules$
cat test.py
python3.5
Same as above with the following end result:
Salt Version:
Salt: 2018.3.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Dec 4 2017, 14:50:18) pyton3.5 if we use the py3 repo
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: UTF-8
machine: x86_64
release: 4.13.0-38-generic
system: Linux
version: Ubuntu 16.04 xenial
The text was updated successfully, but these errors were encountered: