Quieter warnings for now.

We want to throw them in now for salt master/minion startup, but by the
sodium release we'll want to put them back in `salt/__init__.py`,
because if they haven't upgraded to Python3 by that point then they
really really need to get on the ball!
This commit is contained in:
Wayne Werner 2019-01-28 15:29:44 -06:00
parent a52284b990
commit f4a584e33b
No known key found for this signature in database
GPG key ID: C36D3A8D5BEF0935
3 changed files with 24 additions and 14 deletions

View file

@ -95,17 +95,3 @@ __define_global_system_encoding_variable__()
# This is now garbage collectable
del __define_global_system_encoding_variable__
# REMOVEME after Python 2.7 support is dropped
import salt.ext.six as six
if six.PY2:
from salt.utils.versions import warn_until
# Message borrowed from pip's deprecation warning
warn_until('Sodium',
'Python 2.7 will reach the end of its life on January 1st, 2020.'
' Please upgrade your Python as Python 2.7 won\'t be maintained'
' after that date. Salt will drop support for Python 2.7 in the'
' Sodium release.')
# END REMOVEME

View file

@ -3,10 +3,13 @@
Start the salt-master
'''
import salt.ext.six as six
import salt.utils.platform
from salt.scripts import salt_master
if __name__ == '__main__':
if salt.utils.platform.is_windows():
# Since this file does not have a '.py' extension, when running on
@ -19,4 +22,14 @@ if __name__ == '__main__':
cfile = os.path.splitext(__file__)[0] + '.pyc'
if not os.path.exists(cfile):
py_compile.compile(__file__, cfile)
# REMOVEME after Python 2.7 support is dropped (also the six import)
elif six.PY2:
from salt.utils.versions import warn_until
# Message borrowed from pip's deprecation warning
warn_until('Sodium',
'Python 2.7 will reach the end of its life on January 1st,'
' 2020. Please upgrade your Python as Python 2.7 won\'t be'
' maintained after that date. Salt will drop support for'
' Python 2.7 in the Sodium release or later.')
# END REMOVEME
salt_master()

View file

@ -3,6 +3,7 @@
This script is used to kick off a salt minion daemon
'''
import salt.ext.six as six
import salt.utils.platform
from salt.scripts import salt_minion
from multiprocessing import freeze_support
@ -20,6 +21,16 @@ if __name__ == '__main__':
cfile = os.path.splitext(__file__)[0] + '.pyc'
if not os.path.exists(cfile):
py_compile.compile(__file__, cfile)
# REMOVEME after Python 2.7 support is dropped (also the six import)
elif six.PY2:
from salt.utils.versions import warn_until
# Message borrowed from pip's deprecation warning
warn_until('Sodium',
'Python 2.7 will reach the end of its life on January 1st,'
' 2020. Please upgrade your Python as Python 2.7 won\'t be'
' maintained after that date. Salt will drop support for'
' Python 2.7 in the Sodium release or later.')
# END REMOVEME
# This handles the bootstrapping code that is included with frozen
# scripts. It is a no-op on unfrozen code.
freeze_support()