Skip to content

Commit

Permalink
Quieter warnings for now.
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
waynew committed Jan 28, 2019
1 parent a52284b commit f4a584e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
14 changes: 0 additions & 14 deletions salt/__init__.py
Expand Up @@ -95,17 +95,3 @@ def __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
13 changes: 13 additions & 0 deletions scripts/salt-master
Expand Up @@ -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
Expand All @@ -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()
11 changes: 11 additions & 0 deletions scripts/salt-minion
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit f4a584e

Please sign in to comment.