aboutsummaryrefslogtreecommitdiff
path: root/script/jepsen.garage/src/jepsen/garage/set.clj
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-10-18 16:30:45 +0200
committerAlex Auvolat <alex@adnab.me>2023-10-18 16:30:45 +0200
commitddd3de7fcef2a2e05805766085c156d7fde9e12e (patch)
tree27d9c3db3035e2432830912bd693744084d4f682 /script/jepsen.garage/src/jepsen/garage/set.clj
parent84d43501ce6dfd645d844ada0fcbff932d6fea76 (diff)
downloadgarage-ddd3de7fcef2a2e05805766085c156d7fde9e12e.tar.gz
garage-ddd3de7fcef2a2e05805766085c156d7fde9e12e.zip
refactor jepsen code
Diffstat (limited to 'script/jepsen.garage/src/jepsen/garage/set.clj')
-rw-r--r--script/jepsen.garage/src/jepsen/garage/set.clj9
1 files changed, 5 insertions, 4 deletions
diff --git a/script/jepsen.garage/src/jepsen/garage/set.clj b/script/jepsen.garage/src/jepsen/garage/set.clj
index 5f76d1ac..6bbc1ee0 100644
--- a/script/jepsen.garage/src/jepsen/garage/set.clj
+++ b/script/jepsen.garage/src/jepsen/garage/set.clj
@@ -15,7 +15,8 @@
[jepsen.checker.timeline :as timeline]
[jepsen.control.util :as cu]
[jepsen.os.debian :as debian]
- [jepsen.garage.grg :as grg]
+ [jepsen.garage.daemon :as grg]
+ [jepsen.garage.s3api :as s3]
[knossos.model :as model]
[slingshot.slingshot :refer [try+]]))
@@ -25,7 +26,7 @@
(defrecord SetClient [creds]
client/Client
(open! [this test node]
- (let [creds (grg/s3-creds node)]
+ (let [creds (grg/creds node)]
(info node "s3 credentials:" creds)
(assoc this :creds creds)))
(setup! [this test])
@@ -35,10 +36,10 @@
(case (:f op)
:add
(do
- (grg/s3-put (:creds this) (str prefix v) "present")
+ (s3/put (:creds this) (str prefix v) "present")
(assoc op :type :ok))
:read
- (let [items (grg/s3-list (:creds this) prefix)
+ (let [items (s3/list (:creds this) prefix)
items-stripped (map (fn [o] (str/replace-first o prefix "")) items)
items-set (set (map read-string items-stripped))]
(assoc op :type :ok, :value (independent/tuple k items-set))))))