summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
Diffstat (limited to 'subplot')
-rw-r--r--subplot/client.py12
-rw-r--r--subplot/client.yaml3
2 files changed, 13 insertions, 2 deletions
diff --git a/subplot/client.py b/subplot/client.py
index 1dcbe8c..0a09d31 100644
--- a/subplot/client.py
+++ b/subplot/client.py
@@ -24,9 +24,17 @@ def configure_client(ctx, filename=None):
def run_obnam_restore(ctx, filename=None, genid=None, todir=None):
+ genid = ctx["vars"][genid]
+ run_obnam_restore_with_genref(ctx, filename=filename, genref=genid, todir=todir)
+
+
+def run_obnam_restore_latest(ctx, filename=None, todir=None):
+ run_obnam_restore_with_genref(ctx, filename=filename, genref="latest", todir=todir)
+
+
+def run_obnam_restore_with_genref(ctx, filename=None, genref=None, todir=None):
runcmd_run = globals()["runcmd_run"]
- genid = ctx["vars"][genid]
runcmd_run(
ctx,
[
@@ -36,7 +44,7 @@ def run_obnam_restore(ctx, filename=None, genid=None, todir=None):
"--config",
filename,
"restore",
- genid,
+ genref,
todir,
],
)
diff --git a/subplot/client.yaml b/subplot/client.yaml
index f8e89b6..e526304 100644
--- a/subplot/client.yaml
+++ b/subplot/client.yaml
@@ -7,6 +7,9 @@
- when: "I invoke obnam --config {filename} restore <{genid}> {todir}"
function: run_obnam_restore
+- when: "I invoke obnam --config {filename} restore latest {todir}"
+ function: run_obnam_restore_latest
+
- then: "backup generation is {varname}"
function: capture_generation_id