本文整理汇总了Python中resource_management.core.logger.Logger.warn方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.warn方法的具体用法?Python Logger.warn怎么用?Python Logger.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resource_management.core.logger.Logger
的用法示例。
在下文中一共展示了Logger.warn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_nifi_process_status
# 需要导入模块: from resource_management.core.logger import Logger [as 别名]
# 或者: from resource_management.core.logger.Logger import warn [as 别名]
def check_nifi_process_status(self, pid_file):
"""
Function checks whether process is running.
Process is considered running, if pid file exists, and process with
a pid, mentioned in pid file is running
If process is not running, will throw ComponentIsNotRunning exception
@param pid_file: path to service pid file
"""
if not pid_file or not os.path.isfile(pid_file):
raise ComponentIsNotRunning()
try:
lines = [line.rstrip('\n') for line in open(pid_file)]
pid = int(lines[2].split('=')[1]);
except:
Logger.warn("Pid file {0} does not exist".format(pid_file))
raise ComponentIsNotRunning()
code, out = shell.call(["ps","-p", str(pid)])
if code:
Logger.debug("Process with pid {0} is not running. Stale pid file"
" at {1}".format(pid, pid_file))
raise ComponentIsNotRunning()
pass
示例2: resolve_ambari_config
# 需要导入模块: from resource_management.core.logger import Logger [as 别名]
# 或者: from resource_management.core.logger.Logger import warn [as 别名]
def resolve_ambari_config():
config_path = os.path.abspath(AmbariConfig.getConfigFile())
try:
if os.path.exists(config_path):
agent_config.read(config_path)
else:
raise Exception("No config found at %s" % str(config_path))
except Exception, err:
Logger.warn(err)