コード例 #1
0
    def _get_wait_timeout(self, wait):
        if wait is False:
            return False

        if wait not in self.__timeout_cache:
            if not self.is_cib_live:
                raise LibraryError(reports.wait_for_idle_not_live_cluster())
            ensure_wait_for_idle_support(self.cmd_runner())
            self.__timeout_cache[wait] = get_valid_timeout_seconds(wait)
        return self.__timeout_cache[wait]
コード例 #2
0
ファイル: env.py プロジェクト: HideoYamauchi/pcs
    def _get_wait_timeout(self, wait):
        if wait is False:
            return False

        if wait not in self.__timeout_cache:
            if not self.is_cib_live:
                raise LibraryError(reports.wait_for_idle_not_live_cluster())
            ensure_wait_for_idle_support(self.cmd_runner())
            self.__timeout_cache[wait] = get_valid_timeout_seconds(wait)
        return self.__timeout_cache[wait]
コード例 #3
0
ファイル: env.py プロジェクト: nrwahl2/pcs
    def get_wait_timeout(self, wait):
        if wait is False:
            return False

        if wait not in self.__timeout_cache:
            if not self.is_cib_live:
                raise LibraryError(
                    ReportItem.error(
                        reports.messages.WaitForIdleNotLiveCluster()))
            ensure_wait_for_idle_support(self.cmd_runner())
            self.__timeout_cache[wait] = get_valid_timeout_seconds(wait)
        return self.__timeout_cache[wait]
コード例 #4
0
 def test_ensure_support_error(self, mock_obj):
     mock_obj.return_value = False
     assert_raise_library_error(
         lambda: lib.ensure_wait_for_idle_support(mock.Mock()),
         (
             Severity.ERROR,
             report_codes.WAIT_FOR_IDLE_NOT_SUPPORTED,
             {}
         )
     )
コード例 #5
0
ファイル: test_live.py プロジェクト: HideoYamauchi/pcs
 def test_ensure_support_error(self, mock_obj):
     mock_obj.return_value = False
     assert_raise_library_error(
         lambda: lib.ensure_wait_for_idle_support(mock.Mock()),
         (
             Severity.ERROR,
             report_codes.WAIT_FOR_IDLE_NOT_SUPPORTED,
             {}
         )
     )
コード例 #6
0
ファイル: test_live.py プロジェクト: XingWei-Liu/pcs
 def test_ensure_support_success(self, mock_obj):
     mock_obj.return_value = True
     self.assertEqual(None, lib.ensure_wait_for_idle_support(mock.Mock()))
コード例 #7
0
ファイル: test_live.py プロジェクト: HideoYamauchi/pcs
 def test_ensure_support_success(self, mock_obj):
     mock_obj.return_value = True
     self.assertEqual(None, lib.ensure_wait_for_idle_support(mock.Mock()))