Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 3
0
Archivo: env.py Proyecto: 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]
Ejemplo n.º 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,
             {}
         )
     )
Ejemplo n.º 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,
             {}
         )
     )
Ejemplo n.º 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()))
Ejemplo n.º 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()))