util.py revision 447d32b6f572e8ba3100668cb8677c19c0085be6
#
# Various functions
#
# Copyright (c) 2015 Red Hat, Inc.
# Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
import re
import os
import subprocess
import config
"""
Unindent text by removing at most the number of spaces present in
the first non-empty line from the beginning of every line.
"""
indent_ref = [0]
def run_shell():
"""
Execute an interactive shell under "screen", preserving environment.
For use as a breakpoint for debugging.
"""
# screen filter out LD_* evniroment varibles.
# Back-up them and set them later in screenrc
"screen", "-DAm", "-S", "sssd_cwrap_session", "-c",
)
"""Return first argument that points to an existing directory."""
return arg