Merge branch 'develop' of github.com:saltstack/salt into develop

This commit is contained in:
Thomas S Hatch 2012-10-24 17:14:16 -06:00
commit 6dbe1057d2
5 changed files with 76 additions and 27 deletions

View File

@ -27,18 +27,16 @@ number of servers, from a handful of local network systems to international
deployments across disparate datacenters. The topology is a simple
server/client model with the needed functionality built into a single set of
daemons. While the default configuration will work with little to no
modification, Salt can be fine tuned to meet specific needs.
modification, Salt can be fine-tuned to meet specific needs.
Parallel Execution
==================
Granular Controls
=================
The core function of Salt is to enable remote commands to be called in parallel
rather than in serial. It does this over a secure and encrypted protocol using
the smallest and fastest network payloads possible. All of this is possible
and Salt still manages to have a simple interface for developers. Salt also
introduces more granular controls to the realm of remote execution,
allowing for commands to be executed in parallel and for systems to be targeted
based on more than just hostname, but by live system properties.
Salt also introduces powerful granular controls to the realm of remote execution.
By default, commands are executed in parallel. However, using more advanced
options, commands can be executed in batch groups or even in serial. By using
simple built-in filters or regular expression matching, systems can be targeted by
hostname, metadata or system properties such as number of cpus or OS type.
Building on Proven Technology
=============================
@ -83,10 +81,10 @@ influence on the core design tenets.
Open
====
Salt is developed under the `Apache 2.0 licence`_, and can be used for
Salt is developed under the `Apache 2.0 license`_, and can be used for
open and proprietary projects. Please submit your expansions back to
the Salt project so that we can all benefit together as Salt grows.
Finally, please sprinkle some Salt around your systems and let the
deliciousness come forth.
.. _`Apache 2.0 licence`: http://www.apache.org/licenses/LICENSE-2.0.html
.. _`Apache 2.0 license`: http://www.apache.org/licenses/LICENSE-2.0.html

View File

@ -0,0 +1,48 @@
From d21f01128f378cd9bbcf59e7436114594ddf08e4 Mon Sep 17 00:00:00 2001
From: "Jeffrey C. Ollie" <jeff@ocjtech.us>
Date: Tue, 23 Oct 2012 09:20:38 -0500
Subject: [PATCH] Fix systemd service status.
Under systemd, not every service has a "Main PID" so using that to
determine whether a service was running failed for a number of useful
cases, especially services that use systemd's init script
compatibility layer.
Instead, use the 'systemctl is-active' command to determine the status
of a service.
---
salt/modules/systemd.py | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/salt/modules/systemd.py b/salt/modules/systemd.py
index 2e37718..185b1d5 100644
--- a/salt/modules/systemd.py
+++ b/salt/modules/systemd.py
@@ -166,20 +166,15 @@ def reload(name):
# system
def status(name, sig=None):
'''
- Return the status for a service via systemd, returns the PID if the service
- is running or an empty string if the service is not running
+ Return the status for a service via systemd, returns a bool
+ whether the service is running.
CLI Example::
salt '*' service.status <service name>
'''
- ret = __salt__['cmd.run'](_systemctl_cmd('show', name))
- index1 = ret.find('\nMainPID=')
- index2 = ret.find('\n', index1+9)
- mainpid = ret[index1+9:index2]
- if mainpid == '0':
- return ''
- return mainpid
+ cmd = 'systemctl is-active {0}'.format(name)
+ return not __salt__['cmd.retcode'](cmd)
def enable(name):
--
1.7.11.7

View File

@ -9,7 +9,7 @@
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: salt
Version: 0.10.3
Version: 0.10.4
Release: 1%{?dist}
Summary: A parallel remote execution system
@ -24,6 +24,7 @@ Source4: %{name}-master.service
Source5: %{name}-syndic.service
Source6: %{name}-minion.service
Source7: README.fedora
Patch0: 0002-Fix-systemd-service-status.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -111,6 +112,7 @@ Salt minion is queried and controlled from the master.
%prep
%setup -q
%patch0 -p1 -b .systemd
%build
@ -289,6 +291,10 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
* Tue Oct 24 2012 Clint Savage <herlo1@gmail.com> - 0.10.4-1
- Moved to upstream release 0.10.4
- Patched jcollie/systemd-service-status (SALT@GH#2335) (RHBZ#869669)
* Tue Oct 2 2012 Clint Savage <herlo1@gmail.com> - 0.10.3-1
- Moved to upstream release 0.10.3
- Added systemd scriplets (RHBZ#850408)

View File

@ -49,13 +49,10 @@ class RunnerClient(object):
Pass in the runner function name and the low data structure
'''
l_fun = self.functions[fun]
fcall = salt.utils.format_call(l_fun, low)
if 'kwargs' in fcall:
ret = l_fun(*fcall['args'], **fcall['kwargs'])
else:
ret = l_fun(*f_call['args'])
f_call = salt.utils.format_call(l_fun, low)
ret = l_fun(*f_call.get('args', ()), **f_call.get('kwargs', {}))
return ret
class Runner(RunnerClient):
'''

View File

@ -571,27 +571,27 @@ def format_call(fun, data):
aspec = _getargs(fun)
arglen = 0
deflen = 0
if isinstance(aspec[0], list):
arglen = len(aspec[0])
if isinstance(aspec[3], tuple):
deflen = len(aspec[3])
if aspec[2]:
if isinstance(aspec.args, list):
arglen = len(aspec.args)
if isinstance(aspec.defaults, tuple):
deflen = len(aspec.defaults)
if aspec.keywords:
# This state accepts kwargs
ret['kwargs'] = {}
for key in data:
# Passing kwargs the conflict with args == stack trace
if key in aspec[0]:
if key in aspec.args:
continue
ret['kwargs'][key] = data[key]
kwargs = {}
for ind in range(arglen - 1, 0, -1):
minus = arglen - ind
if deflen - minus > -1:
kwargs[aspec[0][ind]] = aspec[3][-minus]
kwargs[aspec.args[ind]] = aspec.defaults[-minus]
for arg in kwargs:
if arg in data:
kwargs[arg] = data[arg]
for arg in aspec[0]:
for arg in aspec.args:
if arg in kwargs:
ret['args'].append(kwargs[arg])
else: