aboutsummaryrefslogtreecommitdiff
path: root/src/garage/admin_rpc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-04-05 19:55:53 +0200
committerAlex Auvolat <alex@adnab.me>2021-04-27 16:37:08 +0200
commit9ced9f78dcc3894b3c2f13b8a95653f990278f03 (patch)
tree00b5180edcfab392eef203f594edb1332ccfce5d /src/garage/admin_rpc.rs
parent3a449badb125b4f5bf0497639745a583bc949da2 (diff)
downloadgarage-9ced9f78dcc3894b3c2f13b8a95653f990278f03.tar.gz
garage-9ced9f78dcc3894b3c2f13b8a95653f990278f03.zip
Improve bootstraping: do it regularly; persist peer list
Diffstat (limited to 'src/garage/admin_rpc.rs')
-rw-r--r--src/garage/admin_rpc.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/garage/admin_rpc.rs b/src/garage/admin_rpc.rs
index df00fcaf..d04dd7a1 100644
--- a/src/garage/admin_rpc.rs
+++ b/src/garage/admin_rpc.rs
@@ -246,15 +246,13 @@ impl AdminRpcHandler {
)))
}
KeyOperation::Import(query) => {
- let prev_key = self.garage.key_table.get(&EmptyKey, &query.key_id)
- .await?;
+ let prev_key = self.garage.key_table.get(&EmptyKey, &query.key_id).await?;
if prev_key.is_some() {
return Err(Error::Message(format!("Key {} already exists in data store. Even if it is deleted, we can't let you create a new key with the same ID. Sorry.", query.key_id)));
}
let imported_key = Key::import(&query.key_id, &query.secret_key, &query.name);
self.garage.key_table.insert(&imported_key).await?;
Ok(AdminRPC::KeyInfo(imported_key))
-
}
}
}