Skip to content

Commit

Permalink
Merge pull request #475 from serokell/krendelhoff/#472-ledger-setup-i…
Browse files Browse the repository at this point in the history
…nterruption-fail

[#472] Handle ledger setup interruption
  • Loading branch information
krendelhoff authored May 25, 2022
2 parents e7a2a45 + eb42a52 commit 9ed204b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docker/package/tezos_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,18 @@ def import_baker_key(self):

key_mode_query = get_key_mode_query(key_import_modes)

self.import_key(key_mode_query, "Baking")
ledger_set_up = False
while not ledger_set_up:
self.import_key(key_mode_query, "Baking")

proc_call(
f"sudo -u tezos {suppress_warning_text} tezos-client {tezos_client_options} "
f"setup ledger to bake for {baker_alias} --main-hwm {self.get_current_head_level()}"
)
try:
proc_call(
f"sudo -u tezos {suppress_warning_text} tezos-client {tezos_client_options} "
f"setup ledger to bake for {baker_alias} --main-hwm {self.get_current_head_level()}"
)
ledger_set_up = True
except PermissionError:
print("Going back to the import mode selection.")

def register_baker(self):
print()
Expand Down

0 comments on commit 9ed204b

Please sign in to comment.