Skip to content

Commit

Permalink
[#467] Display useful snapshot metadata
Browse files Browse the repository at this point in the history
Problem: Function for displaying snapshot metadata
was implemented, but never called.

Solution: Adapt according to new changes and call it.
  • Loading branch information
krendelhoff2 committed Oct 3, 2023
1 parent c1142f8 commit 35a1eb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions baking/src/tezos_baking/tezos_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ def get_snapshot_metadata(self, name, json_url):
except Exception as e:
print(f"\nUnexpected error handling snapshot metadata:\n{e}\n")

def output_snapshot_metadata(self):
def output_snapshot_metadata(self, name):
from datetime import datetime
from locale import setlocale, getlocale, LC_TIME

# it is portable `C` locale by default
setlocale(LC_TIME, getlocale())

metadata = self.config["snapshot_metadata"]
metadata = self.config["snapshots"][name]
timestamp_dt = datetime.strptime(
metadata["block_timestamp"], "%Y-%m-%dT%H:%M:%SZ"
)
Expand Down Expand Up @@ -640,6 +640,7 @@ def fetch_snapshot_from_provider(self, name):
try:
url = self.config["snapshots"][name]["url"]
sha256 = self.config["snapshots"][name]["sha256"]
self.output_snapshot_metadata(name)
return fetch_snapshot(url, sha256)
except KeyError:
raise InterruptStep
Expand Down

0 comments on commit 35a1eb0

Please sign in to comment.