diff options
author | Daniil Baturin <daniil@baturin.org> | 2021-01-14 12:10:49 +0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2021-01-14 12:10:49 +0700 |
commit | 8da20e712814c6f1092f428816299fb4f4cc34d1 (patch) | |
tree | b8de339590146fc239cda1b830d29cc1d151f9d5 /scripts | |
parent | c846984fd748aaa75ecd0cb9f34737034aa35e55 (diff) | |
download | community.vyos.net-8da20e712814c6f1092f428816299fb4f4cc34d1.tar.gz community.vyos.net-8da20e712814c6f1092f428816299fb4f4cc34d1.zip |
Initial version.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/list-snapshots.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/list-snapshots.py b/scripts/list-snapshots.py index b98ab37..0d1cedd 100755 --- a/scripts/list-snapshots.py +++ b/scripts/list-snapshots.py @@ -11,6 +11,8 @@ import json import boto3 +import jinja2 + bucket = os.getenv("SNAPSHOTS_BUCKET") def make_link(s, f): @@ -42,4 +44,17 @@ for name in snapshot_names: snapshots.append(snapshot) -print(json.dumps(snapshots, indent=4)) +#print(json.dumps(snapshots, indent=4)) + +tmpl = jinja2.Template(""" +{% for s in snapshots %} + <h3>{{s.name}}</h3> + <ul> + {% for f in s.files %} + <li><a href="{{f.link}})">{{f.name}} ({{f.platform}})</a></li> + {% endfor %} + </ul> +{% endfor %} +""") + +print(tmpl.render(snapshots=snapshots)) |