mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #51392 from waynew/py2-deprecation-warning
Move deprecation warning after logging starts up
This commit is contained in:
commit
2e69d2b0a1
@ -20,6 +20,7 @@ from random import randint
|
||||
# Import salt libs
|
||||
from salt.exceptions import SaltSystemExit, SaltClientError, SaltReqTimeoutError
|
||||
import salt.defaults.exitcodes # pylint: disable=unused-import
|
||||
import salt.ext.six as six
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -93,6 +94,16 @@ def salt_master():
|
||||
Start the salt master.
|
||||
'''
|
||||
import salt.cli.daemons
|
||||
# REMOVEME after Python 2.7 support is dropped (also the six import)
|
||||
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 or later.')
|
||||
# END REMOVEME
|
||||
master = salt.cli.daemons.Master()
|
||||
master.start()
|
||||
|
||||
@ -179,6 +190,16 @@ def salt_minion():
|
||||
minion = salt.cli.daemons.Minion()
|
||||
minion.start()
|
||||
return
|
||||
# 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
|
||||
|
||||
if '--disable-keepalive' in sys.argv:
|
||||
sys.argv.remove('--disable-keepalive')
|
||||
|
@ -3,13 +3,10 @@
|
||||
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
|
||||
@ -22,14 +19,4 @@ 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()
|
||||
|
@ -3,7 +3,6 @@
|
||||
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
|
||||
@ -21,16 +20,6 @@ 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()
|
||||
|
Loading…
Reference in New Issue
Block a user