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

This commit is contained in:
Pedro Algarvio 2012-11-15 22:15:52 +00:00
commit e797eece4a
5 changed files with 34 additions and 8 deletions

View File

@ -145,3 +145,13 @@ Arch Linux Defaults to Systemd
Arch Linux recently changed to use systemd by default and discontinued support
for init scripts. Salt has followed suit and defaults to systemd now for
managing services in Arch.
Salt, Salt Cloud and Openstack
------------------------------
With the releases of Salt 0.10.5 and Salt Cloud 0.8.2, OpenStack becomes the
first (non-OS) piece of software to include support both on the user level
(with Salt Cloud) and the admin level (with Salt). We are excited to continue
to extend support of other platforms at this level.

View File

@ -70,14 +70,12 @@ def version(name):
salt '*' pkg.version <package name>
'''
# check for :i386 appended to 32bit name installed on 64bit machine
name32bit = '{0}:i386'.format(name)
pkgs = list_pkgs(name)
# check for ':arch' appended to pkg name (i.e. 32 bit installed on 64 bit machine is ':i386')
if name.find(':') >= 0:
name = name.split(':')[0]
if name in pkgs:
return pkgs[name]
if name32bit in pkgs:
return pkgs[name32bit]
else:
return ''

View File

@ -11,7 +11,7 @@ def __virtual__():
'''
Set the user module if the kernel is Linux
'''
return 'group' if __grains__['kernel'] == 'Linux' else False
return 'group' if __grains__.get('kernel', '') == 'Linux' else False
def add(name, gid=None, system=False):

View File

@ -297,12 +297,24 @@ class LogLevelMixIn(object):
def setup_logfile_logger(self):
lfkey = 'key_logfile' if 'key' in self.get_prog_name() else 'log_file'
if self.config.get('log_level_logfile', None) is None:
# Remove it from config so it inherits from log_level
self.config.pop('log_level_logfile', None)
loglevel = self.config.get(
'log_level_logfile', self.config['log_level']
)
if self.config.get('log_fmt_logfile', None) is None:
# Remove it from config so it inherits from log_fmt_console
self.config.pop('log_fmt_logfile', None)
logfmt = self.config.get(
'log_fmt_logfile', self.config['log_fmt_console']
)
if self.config.get('log_datefmt', None) is None:
# Remove it from config so it get's the default value bellow
self.config.pop('log_datefmt', None)
datefmt = self.config.get('log_datefmt', '%Y-%m-%d %H:%M:%S')
log.setup_logfile_logger(
self.config[lfkey],

View File

@ -6,13 +6,19 @@ __version__ = '.'.join(map(str, __version_info__))
# If we can get a version from Git use that instead, otherwise carry on
try:
import os
import subprocess
from salt.utils import which
git = which('git')
if git:
p = subprocess.Popen([git, 'describe'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
p = subprocess.Popen(
[git, 'describe'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=True,
cwd=os.path.abspath(os.path.dirname(__file__))
)
out, err = p.communicate()
if out:
__version__ = '{0}'.format(out.strip().lstrip('v'))