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


Python ActionQueue.execute_status_command方法代码示例

本文整理汇总了Python中ambari_agent.ActionQueue.ActionQueue.execute_status_command方法的典型用法代码示例。如果您正苦于以下问题:Python ActionQueue.execute_status_command方法的具体用法?Python ActionQueue.execute_status_command怎么用?Python ActionQueue.execute_status_command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ambari_agent.ActionQueue.ActionQueue的用法示例。


在下文中一共展示了ActionQueue.execute_status_command方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_execute_status_command_with_alerts

# 需要导入模块: from ambari_agent.ActionQueue import ActionQueue [as 别名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import execute_status_command [as 别名]
  def test_execute_status_command_with_alerts(self, CustomServiceOrchestrator_mock,
                                  build_mock, execute_command_mock,
                                  requestComponentStatus_mock, read_stack_version_mock,
                                  status_update_callback):
    CustomServiceOrchestrator_mock.return_value = None
    dummy_controller = MagicMock()
    actionQueue = ActionQueue(AmbariConfig().getConfig(), dummy_controller)


    requestComponentStatus_mock.reset_mock()
    requestComponentStatus_mock.return_value = {
      'exitcode': 0,
      'stdout': 'out',
      'stderr': 'err',
      'structuredOut': {'alerts': [ {'name': 'flume_alert'} ] }
    }
    build_mock.return_value = {'somestatusresult': 'aresult'}

    actionQueue.execute_status_command(self.status_command_for_alerts)

    report = actionQueue.result()

    self.assertTrue(requestComponentStatus_mock.called)
    self.assertEqual(len(report['componentStatus']), 1)
    self.assertTrue(report['componentStatus'][0].has_key('alerts'))
开发者ID:wbear2,项目名称:ambari,代码行数:27,代码来源:TestActionQueue.py

示例2: test_execute_status_command

# 需要导入模块: from ambari_agent.ActionQueue import ActionQueue [as 别名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import execute_status_command [as 别名]
  def test_execute_status_command(self, CustomServiceOrchestrator_mock,
                                  build_mock, execute_command_mock, requestComponentSecurityState_mock,
                                  requestComponentStatus_mock, read_stack_version_mock,
                                  status_update_callback):
    CustomServiceOrchestrator_mock.return_value = None
    dummy_controller = MagicMock()
    actionQueue = ActionQueue(AmbariConfig(), dummy_controller)

    build_mock.return_value = {'dummy report': '' }

    dummy_controller.recovery_manager = RecoveryManager(tempfile.mktemp())

    requestComponentStatus_mock.reset_mock()
    requestComponentStatus_mock.return_value = {'exitcode': 0 }

    requestComponentSecurityState_mock.reset_mock()
    requestComponentSecurityState_mock.return_value = 'UNKNOWN'

    actionQueue.execute_status_command(self.status_command)
    report = actionQueue.result()
    expected = {'dummy report': '',
                'securityState' : 'UNKNOWN'}

    self.assertEqual(len(report['componentStatus']), 1)
    self.assertEqual(report['componentStatus'][0], expected)
    self.assertTrue(requestComponentStatus_mock.called)
开发者ID:OpenPOWER-BigData,项目名称:HDP-ambari,代码行数:28,代码来源:TestActionQueue.py

示例3: test_execute_status_command

# 需要导入模块: from ambari_agent.ActionQueue import ActionQueue [as 别名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import execute_status_command [as 别名]
  def test_execute_status_command(self, CustomServiceOrchestrator_mock,
                                  build_mock, execute_command_mock,
                                  requestComponentStatus_mock, read_stack_version_mock,
                                  status_update_callback):
    CustomServiceOrchestrator_mock.return_value = None
    dummy_controller = MagicMock()
    actionQueue = ActionQueue(AmbariConfig().getConfig(), dummy_controller)

    build_mock.return_value = "dummy report"

    requestComponentStatus_mock.reset_mock()
    requestComponentStatus_mock.return_value = {'exitcode': 0}
    actionQueue.execute_status_command(self.status_command)
    report = actionQueue.result()
    expected = 'dummy report'
    self.assertEqual(len(report['componentStatus']), 1)
    self.assertEqual(report['componentStatus'][0], expected)
    self.assertTrue(requestComponentStatus_mock.called)
开发者ID:wbear2,项目名称:ambari,代码行数:20,代码来源:TestActionQueue.py


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