Пример #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
    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
 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
 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
 def test_ensure_support_success(self, mock_obj):
     mock_obj.return_value = True
     self.assertEqual(None, lib.ensure_wait_for_idle_support(mock.Mock()))