summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-29 11:39:31 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-29 15:11:53 +0300
commit08b71890de3407acc323f09330ebe8a8ee2782ec (patch)
tree859d2a26dcc5517105bf5078f273fd24672ad756 /subplot
parente839c5f1c93e1fe024a2656d319721a7b23c6461 (diff)
downloadobnam2-08b71890de3407acc323f09330ebe8a8ee2782ec.tar.gz
refactor: only have client config without passwords
This means the config is always the config, and not sometimes the config or the config and passwords. Also, there's no config option for encrypting, anymore. It will not be optional now.
Diffstat (limited to 'subplot')
-rw-r--r--subplot/client.py11
-rw-r--r--subplot/client.yaml5
2 files changed, 14 insertions, 2 deletions
diff --git a/subplot/client.py b/subplot/client.py
index be0a6d6..d0beba5 100644
--- a/subplot/client.py
+++ b/subplot/client.py
@@ -16,7 +16,7 @@ def uninstall_obnam(ctx):
runcmd_run(ctx, ["chmod", "-R", "u+rwX", "."])
-def configure_client(ctx, filename=None):
+def configure_client_without_init(ctx, filename=None):
get_file = globals()["get_file"]
assert ctx.get("server_url") is not None
@@ -35,6 +35,15 @@ def configure_client(ctx, filename=None):
yaml.safe_dump(config, stream=f)
+def configure_client_with_init(ctx, filename=None):
+ runcmd_run = globals()["runcmd_run"]
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+
+ configure_client_without_init(ctx, filename=filename)
+ runcmd_run(ctx, ["obnam", "init", "--insecure-passphrase=hunter2"])
+ runcmd_exit_code_is_zero(ctx)
+
+
def run_obnam_restore(ctx, genid=None, todir=None):
runcmd_run = globals()["runcmd_run"]
diff --git a/subplot/client.yaml b/subplot/client.yaml
index 6de04c9..d660089 100644
--- a/subplot/client.yaml
+++ b/subplot/client.yaml
@@ -3,7 +3,10 @@
cleanup: uninstall_obnam
- given: "a client config based on {filename}"
- function: configure_client
+ function: configure_client_with_init
+
+- given: "a client config, without passphrase, based on {filename}"
+ function: configure_client_without_init
- when: "I invoke obnam restore <{genid}> {todir}"
function: run_obnam_restore