diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-29 00:58:40 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-29 00:58:40 -0400 |
commit | 92be35c42a33384d8dceef7112f1001f64ad101c (patch) | |
tree | 73f789d308e05b5a5a52104e96c55f0dae3373f3 /modules | |
parent | 5666a7aa0ac0c1396ac170ceefbbce36d86f24af (diff) | |
download | puppet-tozt-92be35c42a33384d8dceef7112f1001f64ad101c.tar.gz puppet-tozt-92be35c42a33384d8dceef7112f1001f64ad101c.zip |
fix time since calculations for borg
borg reports times in the local time zone, but doesn't indicate that, so
we need to tell ruby the right thing
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tick/files/plugins/borg | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/tick/files/plugins/borg b/modules/tick/files/plugins/borg index 3e2f1b6..b965cd7 100644 --- a/modules/tick/files/plugins/borg +++ b/modules/tick/files/plugins/borg @@ -11,7 +11,9 @@ repository = data[0]["repository"] archive = data[0]["archives"][0] location = repository["location"] -ago_s = now - DateTime.iso8601(archive["end"]).to_time +end_without_tz = DateTime.iso8601(archive["end"]).to_time +local_end = end_without_tz.getlocal - end_without_tz.getlocal.utc_offset +ago_s = now - local_end dur_s = archive["duration"].to_f file_size_b = archive["stats"]["original_size"] file_count_n = archive["stats"]["nfiles"] |