标签:cmdmod
/usr/lib/python2.6/site-packages/salt/modules/cmdmod.py
cmdmod模块用于执行一些命令行
‘‘ A module for shelling out Keep in mind that this module is insecure, in that it can give whomever has access to the master root execution access to all salt minions. ‘‘‘
# Import python libs import time import functools import json import glob import logging import os import shutil import subprocess import sys import traceback from salt.utils import vt # Import salt libs import salt.utils import salt.utils.timed_subprocess import salt.grains.extra from salt._compat import string_types from salt.exceptions import CommandExecutionError, TimedProcTimeoutError from salt.log import LOG_LEVELS # Only available on POSIX systems, nonfatal on windows try: import pwd except ImportError: pass # Define the module‘s virtual name __virtualname__ = ‘cmd‘ # Set up logging log = logging.getLogger(__name__) DEFAULT_SHELL = salt.grains.extra.shell()[‘shell‘] def __virtual__(): ‘‘‘ Overwriting the cmd python module makes debugging modules with pdb a bit harder so lets do it this way instead. ‘‘‘ return __virtualname__
本文出自 “Linux SA John” 博客,请务必保留此出处http://john88wang.blog.51cto.com/2165294/1655913
标签:cmdmod
原文地址:http://john88wang.blog.51cto.com/2165294/1655913