當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。