aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2023-04-09 21:42:39 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2023-04-09 21:42:39 -0700
commite773e28350957da33ae122c3cfcd0f15b868535b (patch)
tree766e51d1896550a1de3a4c8a586f9a08921509eb
parentarchives: try community solution (diff)
downloadbackend-e773e28350957da33ae122c3cfcd0f15b868535b.tar.gz
backend-e773e28350957da33ae122c3cfcd0f15b868535b.tar.bz2
backend-e773e28350957da33ae122c3cfcd0f15b868535b.zip
ElasticSearch: try to monkeypatch Elasticsearch::UnsupportedProductError
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xag1
-rw-r--r--lib/monkeypatch_es.rb9
-rw-r--r--lib/storage.rb1
3 files changed, 11 insertions, 0 deletions
diff --git a/ag b/ag
index fdbc37f..6131f61 100755
--- a/ag
+++ b/ag
@@ -17,6 +17,7 @@ require_relative 'lib/threading'
require_relative 'lib/rendering'
require_relative 'lib/storage'
require_relative 'lib/hotfixes'
+require_relative 'lib/monkeypatch_es'
$options = OpenStruct.new
$options.action = nil
diff --git a/lib/monkeypatch_es.rb b/lib/monkeypatch_es.rb
new file mode 100644
index 0000000..32437df
--- /dev/null
+++ b/lib/monkeypatch_es.rb
@@ -0,0 +1,9 @@
+# Monkeypatch the real-ES check
+module Elasticsearch
+ class Client
+ def verify_with_version_or_header(version, headers)
+ @verified = true
+ end
+ end
+end
+
diff --git a/lib/storage.rb b/lib/storage.rb
index 5a5948c..879bbfe 100644
--- a/lib/storage.rb
+++ b/lib/storage.rb
@@ -1,6 +1,7 @@
require 'elasticsearch'
require 'date'
require 'pp'
+require 'monkeypatch_es'
module Ag::Storage
module_function