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]
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]
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]
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, {} ) )
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, {} ) )
def test_ensure_support_success(self, mock_obj): mock_obj.return_value = True self.assertEqual(None, lib.ensure_wait_for_idle_support(mock.Mock()))
def test_ensure_support_success(self, mock_obj): mock_obj.return_value = True self.assertEqual(None, lib.ensure_wait_for_idle_support(mock.Mock()))