mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch 'fix-py3-reload-compat' of github.com:mgomersbach/salt into fix-py3-reload-compat
This commit is contained in:
commit
d20581c962
8 changed files with 25 additions and 23 deletions
3
.ci/lint
3
.ci/lint
|
@ -28,6 +28,7 @@ pipeline {
|
|||
# the -l increase the search limit, lets use awk so we do not need to repeat the search above.
|
||||
gawk 'BEGIN {FS="\\t"} {if ($1 != "D") {print $NF}}' file-list-status.log > file-list-changed.log
|
||||
gawk 'BEGIN {FS="\\t"} {if ($1 == "D") {print $NF}}' file-list-status.log > file-list-deleted.log
|
||||
(git diff --name-status -l99999 -C "origin/$CHANGE_TARGET";echo "---";git diff --name-status -l99999 -C "origin/$BRANCH_NAME";printenv|grep -E '=[0-9a-z]{40,}+$|COMMIT=|BRANCH') > file-list-experiment.log
|
||||
touch pylint-report-salt.log pylint-report-tests.log
|
||||
eval "$(pyenv init -)"
|
||||
pyenv --version
|
||||
|
@ -37,7 +38,7 @@ pipeline {
|
|||
python --version
|
||||
pip install tox
|
||||
'''
|
||||
archiveArtifacts artifacts: 'file-list-status.log,file-list-changed.log,file-list-deleted.log'
|
||||
archiveArtifacts artifacts: 'file-list-status.log,file-list-changed.log,file-list-deleted.log,file-list-experiment.log'
|
||||
}
|
||||
}
|
||||
stage('linting') {
|
||||
|
|
|
@ -635,7 +635,7 @@ class AsyncAuth(object):
|
|||
'minion.\nOr restart the Salt Master in open mode to '
|
||||
'clean out the keys. The Salt Minion will now exit.'
|
||||
)
|
||||
sys.exit(salt.defaults.exitcodes.EX_OK)
|
||||
sys.exit(salt.defaults.exitcodes.EX_NOPERM)
|
||||
# has the master returned that its maxed out with minions?
|
||||
elif payload['load']['ret'] == 'full':
|
||||
raise tornado.gen.Return('full')
|
||||
|
@ -1186,7 +1186,7 @@ class SAuth(AsyncAuth):
|
|||
'minion.\nOr restart the Salt Master in open mode to '
|
||||
'clean out the keys. The Salt Minion will now exit.'
|
||||
)
|
||||
sys.exit(salt.defaults.exitcodes.EX_OK)
|
||||
sys.exit(salt.defaults.exitcodes.EX_NOPERM)
|
||||
# has the master returned that its maxed out with minions?
|
||||
elif payload['load']['ret'] == 'full':
|
||||
return 'full'
|
||||
|
|
|
@ -32,6 +32,7 @@ EX_UNAVAILABLE = 69 # service unavailable
|
|||
EX_SOFTWARE = 70 # internal software error
|
||||
EX_CANTCREAT = 73 # can't create (user) output file
|
||||
EX_TEMPFAIL = 75 # temp failure; user is invited to retry
|
||||
EX_NOPERM = 77 # permission denied
|
||||
|
||||
# The Salt specific exit codes are defined below:
|
||||
|
||||
|
|
|
@ -529,9 +529,10 @@ class Master(SMaster):
|
|||
self.process_manager = salt.utils.process.ProcessManager(wait_for_kill=5)
|
||||
pub_channels = []
|
||||
log.info('Creating master publisher process')
|
||||
log_queue = salt.log.setup.get_multiprocessing_logging_queue()
|
||||
for transport, opts in iter_transport_opts(self.opts):
|
||||
chan = salt.transport.server.PubServerChannel.factory(opts)
|
||||
chan.pre_fork(self.process_manager)
|
||||
chan.pre_fork(self.process_manager, kwargs={'log_queue': log_queue})
|
||||
pub_channels.append(chan)
|
||||
|
||||
log.info('Creating master event publisher process')
|
||||
|
@ -589,7 +590,7 @@ class Master(SMaster):
|
|||
log.info('Creating master request server process')
|
||||
kwargs = {}
|
||||
if salt.utils.is_windows():
|
||||
kwargs['log_queue'] = salt.log.setup.get_multiprocessing_logging_queue()
|
||||
kwargs['log_queue'] = log_queue
|
||||
kwargs['secrets'] = SMaster.secrets
|
||||
|
||||
self.process_manager.add_process(
|
||||
|
|
|
@ -92,7 +92,7 @@ class PubServerChannel(object):
|
|||
raise Exception('Channels are only defined for ZeroMQ and raet')
|
||||
# return NewKindOfChannel(opts, **kwargs)
|
||||
|
||||
def pre_fork(self, process_manager):
|
||||
def pre_fork(self, process_manager, kwargs=None):
|
||||
'''
|
||||
Do anything necessary pre-fork. Since this is on the master side this will
|
||||
primarily be used to create IPC channels and create our daemon process to
|
||||
|
|
|
@ -1384,18 +1384,12 @@ class TCPPubServerChannel(salt.transport.server.PubServerChannel):
|
|||
except (KeyboardInterrupt, SystemExit):
|
||||
salt.log.setup.shutdown_multiprocessing_logging()
|
||||
|
||||
def pre_fork(self, process_manager):
|
||||
def pre_fork(self, process_manager, kwargs=None):
|
||||
'''
|
||||
Do anything necessary pre-fork. Since this is on the master side this will
|
||||
primarily be used to create IPC channels and create our daemon process to
|
||||
do the actual publishing
|
||||
'''
|
||||
kwargs = {}
|
||||
if salt.utils.is_windows():
|
||||
kwargs['log_queue'] = (
|
||||
salt.log.setup.get_multiprocessing_logging_queue()
|
||||
)
|
||||
|
||||
process_manager.add_process(self._publish_daemon, kwargs=kwargs)
|
||||
|
||||
def publish(self, load):
|
||||
|
|
|
@ -21,6 +21,7 @@ from salt.ext.six.moves import map
|
|||
import salt.auth
|
||||
import salt.crypt
|
||||
import salt.utils
|
||||
import salt.log.setup
|
||||
import salt.utils.verify
|
||||
import salt.utils.event
|
||||
import salt.utils.files
|
||||
|
@ -745,11 +746,15 @@ class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
|
|||
def connect(self):
|
||||
return tornado.gen.sleep(5)
|
||||
|
||||
def _publish_daemon(self):
|
||||
def _publish_daemon(self, log_queue=None):
|
||||
'''
|
||||
Bind to the interface specified in the configuration file
|
||||
'''
|
||||
salt.utils.appendproctitle(self.__class__.__name__)
|
||||
if log_queue:
|
||||
salt.log.setup.set_multiprocessing_logging_queue(log_queue)
|
||||
salt.log.setup.setup_multiprocessing_logging(log_queue)
|
||||
|
||||
# Set up the context
|
||||
context = zmq.Context(1)
|
||||
# Prepare minion publish socket
|
||||
|
@ -841,7 +846,7 @@ class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
|
|||
if context.closed is False:
|
||||
context.term()
|
||||
|
||||
def pre_fork(self, process_manager):
|
||||
def pre_fork(self, process_manager, kwargs=None):
|
||||
'''
|
||||
Do anything necessary pre-fork. Since this is on the master side this will
|
||||
primarily be used to create IPC channels and create our daemon process to
|
||||
|
@ -849,7 +854,7 @@ class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
|
|||
|
||||
:param func process_manager: A ProcessManager, from salt.utils.process.ProcessManager
|
||||
'''
|
||||
process_manager.add_process(self._publish_daemon)
|
||||
process_manager.add_process(self._publish_daemon, kwargs=kwargs)
|
||||
|
||||
def publish(self, load):
|
||||
'''
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
ec2-test:
|
||||
provider: ec2-config
|
||||
image: ami-98aa1cf0
|
||||
size: m1.large
|
||||
sh_username: ec2-user
|
||||
image: ami-3ecc8f46
|
||||
size: c5.large
|
||||
sh_username: centos
|
||||
script_args: '-P'
|
||||
ec2-win2012r2-test:
|
||||
provider: ec2-config
|
||||
size: m1.large
|
||||
image: ami-eb1ecd96
|
||||
size: c5.large
|
||||
image: ami-02e27664434db6def
|
||||
smb_port: 445
|
||||
win_installer: ''
|
||||
win_username: Administrator
|
||||
|
@ -19,8 +19,8 @@ ec2-win2012r2-test:
|
|||
deploy: True
|
||||
ec2-win2016-test:
|
||||
provider: ec2-config
|
||||
size: m1.large
|
||||
image: ami-ed14c790
|
||||
size: c5.large
|
||||
image: ami-017bf00eb0d4c7182
|
||||
smb_port: 445
|
||||
win_installer: ''
|
||||
win_username: Administrator
|
||||
|
|
Loading…
Add table
Reference in a new issue