Exemple #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]
Exemple #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]
Exemple #3
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(
                    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]
Exemple #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,
             {}
         )
     )
Exemple #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,
             {}
         )
     )
Exemple #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()))
Exemple #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()))