mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #51671 from Ch3LL/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
This commit is contained in:
commit
a59585d80e
4 changed files with 17 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>salt-minion</string>
|
||||
<string>com.saltstack.salt.minion</string>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
|
|
|
@ -341,6 +341,16 @@ class Minion(salt.utils.parsers.MinionOptionParser, DaemonsMixin): # pylint: di
|
|||
NOTE: Run any required code before calling `super()`.
|
||||
'''
|
||||
super(Minion, self).start()
|
||||
while True:
|
||||
try:
|
||||
self._real_start()
|
||||
except SaltClientError as exc:
|
||||
# Restart for multi_master failover when daemonized
|
||||
if self.options.daemon:
|
||||
continue
|
||||
break
|
||||
|
||||
def _real_start(self):
|
||||
try:
|
||||
if check_user(self.config['user']):
|
||||
self.action_log_info('Starting up')
|
||||
|
|
|
@ -22,6 +22,7 @@ from __future__ import absolute_import, unicode_literals, print_function
|
|||
# Import python libs
|
||||
import logging
|
||||
import salt.utils.path
|
||||
import json
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -69,7 +70,10 @@ def present(name,
|
|||
if policy:
|
||||
if policy.get('pattern') != pattern:
|
||||
updates.append('Pattern')
|
||||
if policy.get('definition') != definition:
|
||||
current_definition = policy.get('definition')
|
||||
current_definition = json.loads(current_definition) if current_definition else ''
|
||||
new_definition = json.loads(definition) if definition else ''
|
||||
if current_definition != new_definition:
|
||||
updates.append('Definition')
|
||||
if apply_to and (policy.get('apply-to') != apply_to):
|
||||
updates.append('Applyto')
|
||||
|
|
|
@ -775,7 +775,7 @@ class TestFileState(TestCase, LoaderModuleMockMixin):
|
|||
with patch.object(os.path, 'exists', mock_t):
|
||||
with patch.dict(filestate.__opts__, {'test': True}):
|
||||
ret.update({'comment': comt})
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.platform.is_windows():
|
||||
self.assertDictEqual(filestate.managed
|
||||
(name, user=user,
|
||||
group=group), ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue