mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #1257 from jhutchins/choose_shell
Use shell grain as default in modules/cmdmod.py
This commit is contained in:
commit
a97c97d217
@ -544,17 +544,6 @@ def saltversion():
|
||||
from salt import __version__
|
||||
return {'saltversion': __version__}
|
||||
|
||||
def shell():
|
||||
'''
|
||||
Return the default shell to use on this system
|
||||
'''
|
||||
# Provides:
|
||||
# shell
|
||||
ret = {'shell': '/bin/sh'}
|
||||
if 'SHELL' in os.environ:
|
||||
ret['shell'] = os.environ['SHELL']
|
||||
return ret
|
||||
|
||||
# Relatively complex mini-algorithm to iterate over the various
|
||||
# sections of dmidecode output and return matches for specific
|
||||
# lines containing data we want, but only in the right section.
|
||||
|
13
salt/grains/extra.py
Normal file
13
salt/grains/extra.py
Normal file
@ -0,0 +1,13 @@
|
||||
import os
|
||||
|
||||
def shell():
|
||||
'''
|
||||
Return the default shell to use on this system
|
||||
'''
|
||||
# Provides:
|
||||
# shell
|
||||
ret = {'shell': '/bin/sh'}
|
||||
if 'SHELL' in os.environ:
|
||||
ret['shell'] = os.environ['SHELL']
|
||||
return ret
|
||||
|
@ -11,6 +11,7 @@ import subprocess
|
||||
import tempfile
|
||||
import salt.utils
|
||||
from salt.exceptions import CommandExecutionError
|
||||
from salt.grains.extra import shell as shell_grain
|
||||
|
||||
# Only available on posix systems, nonfatal on windows
|
||||
try:
|
||||
@ -27,8 +28,7 @@ __outputter__ = {
|
||||
'run': 'txt',
|
||||
}
|
||||
|
||||
|
||||
DEFAULT_SHELL = '/bin/sh'
|
||||
DEFAULT_SHELL = shell_grain()['shell']
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user