mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Move deprecation warning after logging starts up
It was getting called in the other spot, it just wasn't actually doing anything. Here it prints the message on the cli
This commit is contained in:
parent
f4a584e33b
commit
0ed4326e94
3 changed files with 21 additions and 24 deletions
|
@ -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…
Add table
Reference in a new issue