2014-11-14 22:14:08 +00:00
|
|
|
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
|
2014-10-15 22:35:16 +00:00
|
|
|
#
|
2014-11-14 22:14:08 +00:00
|
|
|
# This file is part of Ansible.
|
2014-10-15 22:35:16 +00:00
|
|
|
#
|
|
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
2015-04-13 20:28:01 +00:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
2014-10-15 23:25:48 +00:00
|
|
|
|
2015-04-14 21:05:02 +00:00
|
|
|
from ansible.plugins.shell.sh import ShellModule as ShModule
|
2014-10-15 23:25:48 +00:00
|
|
|
|
2014-11-14 22:14:08 +00:00
|
|
|
class ShellModule(ShModule):
|
|
|
|
|
2015-03-03 00:08:08 +00:00
|
|
|
# How to end lines in a python script one-liner
|
|
|
|
_SHELL_EMBEDDED_PY_EOL = '\\\n'
|
2015-08-30 21:48:09 +00:00
|
|
|
_SHELL_REDIRECT_ALLNULL = '>& /dev/null'
|
2015-03-03 00:08:08 +00:00
|
|
|
|
2014-11-14 22:14:08 +00:00
|
|
|
def env_prefix(self, **kwargs):
|
|
|
|
return 'env %s' % super(ShellModule, self).env_prefix(**kwargs)
|