Merge branch '2015.8' into '2016.3'

Conflicts:
  - tests/integration/__init__.py
This commit is contained in:
rallytime 2016-07-27 11:35:16 -06:00
commit a7d4f93697
5 changed files with 12 additions and 11 deletions

View file

@ -1303,7 +1303,12 @@ class LocalClient(object):
if min_ret.get('failed') is True:
if connected_minions is None:
connected_minions = salt.utils.minions.CkMinions(self.opts).connected_ids()
if connected_minions and id_ not in connected_minions:
minion_cache = os.path.join(self.opts['cachedir'], 'minions', id_, 'data.p')
if self.opts['minion_data_cache'] \
and os.path.exists(minion_cache) \
and connected_minions \
and id_ not in connected_minions:
yield {id_: {'out': 'no_return',
'ret': 'Minion did not return. [Not connected]'}}
else:

View file

@ -131,11 +131,7 @@ def main(argv): # pylint: disable=W0613
thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE)
if os.path.isfile(thin_path):
if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc):
sys.stderr.write('{0}\n'.format(OPTIONS.checksum))
sys.stderr.write('{0}\n'.format(get_hash(thin_path, OPTIONS.hashfunc)))
os.unlink(thin_path)
sys.stderr.write('WARNING: checksum mismatch for "{0}"\n'.format(thin_path))
sys.exit(EX_THIN_CHECKSUM)
need_deployment()
unpack_thin(thin_path)
# Salt thin now is available to use
else:

View file

@ -1241,12 +1241,12 @@ class ShellCase(AdaptedConfigurationTestCaseMixIn, ShellTestCase):
arg_str = '-c {0} {1}'.format(self.get_config_dir(), arg_str)
return self.run_script('salt', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=30)
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False):
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, timeout=25): # pylint: disable=W0221
'''
Execute salt-ssh
'''
arg_str = '-W -c {0} -i --priv {1} --roster-file {2} --out=json localhost {3}'.format(self.get_config_dir(), os.path.join(TMP_CONF_DIR, 'key_test'), os.path.join(TMP_CONF_DIR, 'roster'), arg_str)
return self.run_script('salt-ssh', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, raw=True, timeout=30)
return self.run_script('salt-ssh', arg_str, with_retcode=with_retcode, catch_stderr=catch_stderr, timeout=timeout, raw=True)
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, async=False, timeout=60, config_dir=None):
'''
@ -1380,7 +1380,7 @@ class SSHCase(ShellCase):
return '{0} {1}'.format(function, ' '.join(arg))
def run_function(self, function, arg=(), timeout=25, **kwargs):
ret = self.run_ssh(self._arg_str(function, arg))
ret = self.run_ssh(self._arg_str(function, arg), timeout=timeout)
try:
return json.loads(ret)['localhost']
except Exception:

View file

@ -59,7 +59,7 @@ class GrainsTargetingTest(integration.ShellCase):
'''
Tests return of minion using grains targeting on a disconnected minion.
'''
test_ret = 'Minion did not return. [Not connected]'
test_ret = 'Minion did not return. [No response]'
# Create a minion key, but do not start the "fake" minion. This mimics a
# disconnected minion.

View file

@ -120,7 +120,7 @@ class StdTest(integration.ModuleCase):
'''
Test return/messaging on a disconnected minion
'''
test_ret = {'ret': 'Minion did not return. [Not connected]', 'out': 'no_return'}
test_ret = {'ret': 'Minion did not return. [No response]', 'out': 'no_return'}
# Create a minion key, but do not start the "fake" minion. This mimics
# a disconnected minion.