mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2017.7' into fix_win_service
This commit is contained in:
commit
53e2e05766
4 changed files with 6 additions and 75 deletions
|
@ -32,20 +32,9 @@ possible solution or implementation.
|
|||
|
||||
- ``Blocked`` - The issue is waiting on actions by parties outside of
|
||||
SaltStack, such as receiving more information from the submitter or
|
||||
resolution of an upstream issue. This milestone is usually applied in
|
||||
conjunction with the labels ``Info Needed``, ``Question``, ``Expected
|
||||
Behavior``, ``Won't Fix For Now``, or ``Upstream Bug``.
|
||||
|
||||
- ``Under Review`` - The issue is having further validation done by a SaltStack
|
||||
engineer.
|
||||
|
||||
- ``<Sprint>`` - The issue is being actively worked on by a SaltStack engineer.
|
||||
Sprint milestones names are constructed from the chemical symbol of the next
|
||||
release's codename and the number of sprints until that release is made. For
|
||||
example, if the next release codename is ``Neon`` and there are five sprints
|
||||
until that release, the corresponding sprint milestone will be called ``Ne
|
||||
5``. See :ref:`here <version-numbers>` for a discussion of Salt's release
|
||||
codenames.
|
||||
resolution of an upstream issue. This milestone is usually applied in
|
||||
conjunction with the labels ``Info Needed``, ``Question``,
|
||||
``Expected Behavior``, ``Won't Fix For Now``, or ``Upstream Bug``.
|
||||
|
||||
Labels
|
||||
======
|
||||
|
|
|
@ -341,12 +341,12 @@ class SSH(object):
|
|||
'''
|
||||
Deploy the SSH key if the minions don't auth
|
||||
'''
|
||||
if not isinstance(ret[host], dict) or self.opts.get('ssh_key_deploy') is True:
|
||||
if not isinstance(ret[host], dict) or self.opts.get('ssh_key_deploy'):
|
||||
target = self.targets[host]
|
||||
if target.get('passwd', False) or self.opts['ssh_passwd']:
|
||||
self._key_deploy_run(host, target, False)
|
||||
return ret
|
||||
if ret[host].get('stderr', '').count('Permission denied') and not self.opts.get('ssh_key_deploy') is False:
|
||||
if ret[host].get('stderr', '').count('Permission denied'):
|
||||
target = self.targets[host]
|
||||
# permission denied, attempt to auto deploy ssh key
|
||||
print(('Permission denied for host {0}, do you want to deploy '
|
||||
|
|
|
@ -3023,21 +3023,12 @@ class SaltSSHOptionParser(six.with_metaclass(OptionParserMeta,
|
|||
auth_group.add_option(
|
||||
'--key-deploy',
|
||||
dest='ssh_key_deploy',
|
||||
default=None,
|
||||
default=False,
|
||||
action='store_true',
|
||||
help='Set this flag to attempt to deploy the authorized ssh key '
|
||||
'with all minions. This combined with --passwd can make '
|
||||
'initial deployment of keys very fast and easy.'
|
||||
)
|
||||
auth_group.add_option(
|
||||
'--no-key-deploy',
|
||||
dest='ssh_key_deploy',
|
||||
default=None,
|
||||
action='store_false',
|
||||
help='Set this flag to stop salt-ssh from attempting to deploy an authorized ssh key '
|
||||
'with all minions. This is useful to skip the message about deploying to minions '
|
||||
'that cannot be logged into.'
|
||||
)
|
||||
auth_group.add_option(
|
||||
'--identities-only',
|
||||
dest='ssh_identities_only',
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
:codeauthor: :email:`Daniel Wallace (daniel@saltstack.com)`
|
||||
|
||||
|
||||
====================================
|
||||
Test Case for --no-key-deploy
|
||||
====================================
|
||||
'''
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
# Import Python Libs
|
||||
import os
|
||||
import json
|
||||
|
||||
# Import Tests Libs
|
||||
from tests.support.case import SSHCase
|
||||
from tests.support.runtests import RUNTIME_VARS
|
||||
|
||||
|
||||
class SSHKeyDeployQuestionCase(SSHCase):
|
||||
|
||||
def _run_ssh(self, arg_str, with_retcode=False, timeout=25, catch_stderr=False):
|
||||
|
||||
arg_str = '-ldebug -c {0} -i --roster-file {1} --out=json localhost {2}'.format(
|
||||
self.get_config_dir(),
|
||||
os.path.join(RUNTIME_VARS.TMP_CONF_DIR, '_ssh', 'roster'),
|
||||
arg_str,
|
||||
)
|
||||
return self.run_script('salt-ssh',
|
||||
arg_str,
|
||||
with_retcode=with_retcode,
|
||||
catch_stderr=catch_stderr,
|
||||
timeout=timeout,
|
||||
raw=True)
|
||||
|
||||
def test_no_key_deploy(self):
|
||||
exp = {
|
||||
'localhost': {
|
||||
'stdout': '',
|
||||
'stderr': "Permission denied (publickey).\r\n",
|
||||
'retcode': 255,
|
||||
},
|
||||
}
|
||||
assert json.loads(self._run_ssh('--no-key-deploy localhost test.ping')) == exp
|
||||
|
||||
def test_key_deploy(self):
|
||||
exp = ['Process took more than 5 seconds to complete. Process Killed!']
|
||||
assert self._run_ssh('localhost test.ping', timeout=5) == exp
|
Loading…
Add table
Reference in a new issue