当前位置: 首页>>代码示例>>Python>>正文


Python Logger.warn方法代码示例

本文整理汇总了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
开发者ID:fanzhidongyzby,项目名称:ambari,代码行数:28,代码来源:nifi.py

示例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)
开发者ID:OpenPOWER-BigData,项目名称:HDP-ambari,代码行数:11,代码来源:ru_execute_tasks.py


注:本文中的resource_management.core.logger.Logger.warn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。