mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge branch '2014.7' into develop
Conflicts: salt/output/key.py
This commit is contained in:
commit
999d695d8f
@ -7,9 +7,9 @@ Is Salt open-core?
|
||||
------------------
|
||||
|
||||
No. Salt is 100% committed to being open-source, including all of our APIs and
|
||||
the new `'Halite' web interface`_ which was introduced in version 0.17.0. It
|
||||
is developed under the `Apache 2.0 license`_, allowing it to be used in both
|
||||
open and proprietary projects.
|
||||
the `'Halite' web interface`_ which was introduced in version 0.17.0. It is
|
||||
developed under the `Apache 2.0 license`_, allowing it to be used in both open
|
||||
and proprietary projects.
|
||||
|
||||
.. _`'Halite' web interface`: https://github.com/saltstack/halite
|
||||
.. _`Apache 2.0 license`: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
@ -278,6 +278,7 @@ class SSH(object):
|
||||
self.opts,
|
||||
argv,
|
||||
host,
|
||||
mods=self.mods,
|
||||
**target)
|
||||
if salt.utils.which('ssh-copy-id'):
|
||||
# we have ssh-copy-id, use it!
|
||||
@ -290,6 +291,7 @@ class SSH(object):
|
||||
self.opts,
|
||||
self.opts['argv'],
|
||||
host,
|
||||
mods=self.mods,
|
||||
**target)
|
||||
stdout, stderr, retcode = single.cmd_block()
|
||||
try:
|
||||
@ -639,6 +641,7 @@ class Single(object):
|
||||
pre_wrapper = salt.client.ssh.wrapper.FunctionWrapper(
|
||||
self.opts,
|
||||
self.id,
|
||||
mods=self.mods,
|
||||
**self.target)
|
||||
opts_pkg = pre_wrapper['test.opts_pkg']()
|
||||
opts_pkg['file_roots'] = self.opts['file_roots']
|
||||
@ -687,6 +690,7 @@ class Single(object):
|
||||
wrapper = salt.client.ssh.wrapper.FunctionWrapper(
|
||||
opts,
|
||||
self.id,
|
||||
mods=self.mods,
|
||||
**self.target)
|
||||
self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper, self.opts)
|
||||
wrapper.wfuncs = self.wfuncs
|
||||
@ -961,9 +965,9 @@ def mod_data(opts):
|
||||
pl_dir = os.path.join(path, '_{0}'.format(ref))
|
||||
if os.path.isdir(pl_dir):
|
||||
for fn_ in os.listdir(pl_dir):
|
||||
if not os.path.isfile(fn_):
|
||||
continue
|
||||
mod_path = os.path.join(pl_dir, fn_)
|
||||
if not os.path.isfile(mod_path):
|
||||
continue
|
||||
with open(mod_path) as fp_:
|
||||
code_str = fp_.read().encode('base64')
|
||||
mod_str += '{0}|{1},'.format(fn_, code_str)
|
||||
|
@ -162,7 +162,6 @@ def write_modules():
|
||||
'var',
|
||||
'cache',
|
||||
'salt',
|
||||
'minion',
|
||||
'extmods')
|
||||
for mtype in mtypes:
|
||||
dest_dir = os.path.join(modcache, mtype)
|
||||
|
@ -25,10 +25,15 @@ class FunctionWrapper(dict):
|
||||
id_,
|
||||
host,
|
||||
wfuncs=None,
|
||||
mods=None,
|
||||
**kwargs):
|
||||
super(FunctionWrapper, self).__init__()
|
||||
self.wfuncs = wfuncs if isinstance(wfuncs, dict) else {}
|
||||
self.opts = opts
|
||||
if isinstance(mods, dict):
|
||||
self.mods = mods
|
||||
else:
|
||||
self.mods = {}
|
||||
self.kwargs = {'id_': id_,
|
||||
'host': host}
|
||||
self.kwargs.update(kwargs)
|
||||
@ -50,6 +55,7 @@ class FunctionWrapper(dict):
|
||||
single = salt.client.ssh.Single(
|
||||
self.opts,
|
||||
argv,
|
||||
mods=self.mods,
|
||||
**self.kwargs
|
||||
)
|
||||
stdout, stderr, _ = single.cmd_block()
|
||||
|
@ -56,12 +56,6 @@ try:
|
||||
except ImportError:
|
||||
HAS_HALITE = False
|
||||
|
||||
try:
|
||||
import systemd.daemon
|
||||
HAS_PYTHON_SYSTEMD = True
|
||||
except ImportError:
|
||||
HAS_PYTHON_SYSTEMD = False
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -495,13 +489,6 @@ class ReqServer(object):
|
||||
|
||||
self.workers.bind(self.w_uri)
|
||||
|
||||
try:
|
||||
if HAS_PYTHON_SYSTEMD and systemd.daemon.booted():
|
||||
systemd.daemon.notify('READY=1')
|
||||
except SystemError:
|
||||
# Daemon wasn't started by systemd
|
||||
pass
|
||||
|
||||
while True:
|
||||
try:
|
||||
zmq.device(zmq.QUEUE, self.clients, self.workers)
|
||||
|
@ -134,6 +134,10 @@ def option(
|
||||
return __opts__[value]
|
||||
if not omit_master:
|
||||
if value in __pillar__.get('master', {}):
|
||||
salt.utils.warn_until(
|
||||
'Lithium',
|
||||
'pillar_opts will default to False in the Lithium release'
|
||||
)
|
||||
return __pillar__['master'][value]
|
||||
if not omit_pillar:
|
||||
if value in __pillar__:
|
||||
@ -168,6 +172,10 @@ def merge(value,
|
||||
return ret
|
||||
if not omit_master:
|
||||
if value in __pillar__.get('master', {}):
|
||||
salt.utils.warn_until(
|
||||
'Lithium',
|
||||
'pillar_opts will default to False in the Lithium release'
|
||||
)
|
||||
tmp = __pillar__['master'][value]
|
||||
if ret is None:
|
||||
ret = tmp
|
||||
@ -241,6 +249,10 @@ def get(key, default=''):
|
||||
return sdb.sdb_get(ret, __opts__)
|
||||
|
||||
ret = salt.utils.traverse_dict_and_list(__pillar__.get('master', {}), key, '_|-')
|
||||
salt.utils.warn_until(
|
||||
'Lithium',
|
||||
'pillar_opts will default to False in the Lithium release'
|
||||
)
|
||||
if ret != '_|-':
|
||||
return sdb.sdb_get(ret, __opts__)
|
||||
|
||||
@ -260,6 +272,10 @@ def dot_vals(value):
|
||||
'''
|
||||
ret = {}
|
||||
for key, val in __pillar__.get('master', {}).items():
|
||||
salt.utils.warn_until(
|
||||
'Lithium',
|
||||
'pillar_opts will default to False in the Lithium release'
|
||||
)
|
||||
if key.startswith('{0}.'.format(value)):
|
||||
ret[key] = val
|
||||
for key, val in __opts__.items():
|
||||
|
@ -376,7 +376,7 @@ def refresh_db():
|
||||
)
|
||||
|
||||
|
||||
def upgrade(refresh=True):
|
||||
def upgrade(refresh=True): # pylint: disable=W0613
|
||||
'''
|
||||
Run a full upgrade using MacPorts 'port upgrade outdated'
|
||||
|
||||
|
@ -480,6 +480,8 @@ def interface(iface):
|
||||
'''
|
||||
Return the inet address for a given interface
|
||||
|
||||
.. versionadded:: 2014.7
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -493,6 +495,8 @@ def interface_ip(iface):
|
||||
'''
|
||||
Return the inet address for a given interface
|
||||
|
||||
.. versionadded:: 2014.7
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -648,6 +652,8 @@ def connect(host, port=None, **kwargs):
|
||||
Test connectivity to a host using a particular
|
||||
port from the minion.
|
||||
|
||||
.. versionadded:: 2014.7
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -23,32 +23,50 @@ def output(data):
|
||||
pend = 'minions_pre'
|
||||
den = 'minions_denied'
|
||||
rej = 'minions_rejected'
|
||||
|
||||
cmap = {pend: color['RED'],
|
||||
acc: color['GREEN'],
|
||||
den: color['PURPLE'],
|
||||
rej: color['BLUE'],
|
||||
'local': color['PURPLE']}
|
||||
|
||||
trans = {pend: u'{0}Unaccepted Keys:{1}'.format(
|
||||
color['LIGHT_RED'],
|
||||
color['ENDC']),
|
||||
acc: u'{0}Accepted Keys:{1}'.format(
|
||||
color['LIGHT_GREEN'],
|
||||
color['ENDC']),
|
||||
den: u'{0}Denied Keys:{1}'.format(
|
||||
color['LIGHT_PURPLE'],
|
||||
color['ENDC']),
|
||||
rej: u'{0}Rejected Keys:{1}'.format(
|
||||
color['LIGHT_BLUE'],
|
||||
color['ENDC']),
|
||||
'local': u'{0}Local Keys:{1}'.format(
|
||||
color['LIGHT_PURPLE'],
|
||||
color['ENDC'])}
|
||||
else:
|
||||
acc = 'accepted'
|
||||
pend = 'pending'
|
||||
rej = 'rejected'
|
||||
|
||||
cmap = {pend: color['RED'],
|
||||
acc: color['GREEN'],
|
||||
den: color['PURPLE'],
|
||||
rej: color['BLUE'],
|
||||
'local': color['PURPLE']}
|
||||
cmap = {pend: color['RED'],
|
||||
acc: color['GREEN'],
|
||||
rej: color['BLUE'],
|
||||
'local': color['PURPLE']}
|
||||
|
||||
trans = {pend: u'{0}Unaccepted Keys:{1}'.format(
|
||||
color['LIGHT_RED'],
|
||||
color['ENDC']),
|
||||
acc: u'{0}Accepted Keys:{1}'.format(
|
||||
color['LIGHT_GREEN'],
|
||||
color['ENDC']),
|
||||
den: u'{0}Denied Keys:{1}'.format(
|
||||
color['LIGHT_PURPLE'],
|
||||
color['ENDC']),
|
||||
rej: u'{0}Rejected Keys:{1}'.format(
|
||||
color['LIGHT_BLUE'],
|
||||
color['ENDC']),
|
||||
'local': u'{0}Local Keys:{1}'.format(
|
||||
color['LIGHT_PURPLE'],
|
||||
color['ENDC'])}
|
||||
trans = {pend: u'{0}Unaccepted Keys:{1}'.format(
|
||||
color['LIGHT_RED'],
|
||||
color['ENDC']),
|
||||
acc: u'{0}Accepted Keys:{1}'.format(
|
||||
color['LIGHT_GREEN'],
|
||||
color['ENDC']),
|
||||
rej: u'{0}Rejected Keys:{1}'.format(
|
||||
color['LIGHT_BLUE'],
|
||||
color['ENDC']),
|
||||
'local': u'{0}Local Keys:{1}'.format(
|
||||
color['LIGHT_PURPLE'],
|
||||
color['ENDC'])}
|
||||
|
||||
ret = ''
|
||||
|
||||
|
@ -19,6 +19,12 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import systemd.daemon
|
||||
HAS_PYTHON_SYSTEMD = True
|
||||
except ImportError:
|
||||
HAS_PYTHON_SYSTEMD = False
|
||||
|
||||
|
||||
def set_pidfile(pidfile, user):
|
||||
'''
|
||||
@ -178,6 +184,13 @@ class ProcessManager(object):
|
||||
# make sure to kill the subprocesses if the parent is killed
|
||||
signal.signal(signal.SIGTERM, self.kill_children)
|
||||
|
||||
try:
|
||||
if HAS_PYTHON_SYSTEMD and systemd.daemon.booted():
|
||||
systemd.daemon.notify('READY=1')
|
||||
except SystemError:
|
||||
# Daemon wasn't started by systemd
|
||||
pass
|
||||
|
||||
while True:
|
||||
try:
|
||||
pid, exit_status = os.wait()
|
||||
|
Loading…
Reference in New Issue
Block a user