Fixes configuration failure modes in deploy.py (#604)
This commit is contained in:
22
deploy.py
22
deploy.py
@@ -795,6 +795,7 @@ class OpenSKInstaller:
|
|||||||
info("No application selected.")
|
info("No application selected.")
|
||||||
else:
|
else:
|
||||||
self.build_example()
|
self.build_example()
|
||||||
|
self.args.configure = False
|
||||||
|
|
||||||
# Erase persistent storage
|
# Erase persistent storage
|
||||||
if self.args.clear_storage:
|
if self.args.clear_storage:
|
||||||
@@ -888,6 +889,18 @@ class OpenSKInstaller:
|
|||||||
self.configure()
|
self.configure()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def print_configure_help(self):
|
||||||
|
vendor_hid = " --vendor-hid" if "vendor_hid" in self.args.features else ""
|
||||||
|
info("Your device is not yet configured, and lacks some functionality. "
|
||||||
|
"You can check its configuration status with:\n\n"
|
||||||
|
f"./tools/configure.py{vendor_hid}\n\n"
|
||||||
|
"If you run into issues, this command might help:\n\n"
|
||||||
|
f"./tools/configure.py{vendor_hid} \\\n"
|
||||||
|
" --certificate=crypto_data/opensk_cert.pem \\\n"
|
||||||
|
" --private-key=crypto_data/opensk.key\n\n"
|
||||||
|
"Please read the Certificate considerations in docs/customization.md"
|
||||||
|
" to understand the privacy trade-off.")
|
||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
info("Configuring device.")
|
info("Configuring device.")
|
||||||
# Trying to check or configure the device. Booting might take some time.
|
# Trying to check or configure the device. Booting might take some time.
|
||||||
@@ -899,6 +912,7 @@ class OpenSKInstaller:
|
|||||||
break
|
break
|
||||||
|
|
||||||
if not devices:
|
if not devices:
|
||||||
|
self.print_configure_help()
|
||||||
fatal("No device to configure found.")
|
fatal("No device to configure found.")
|
||||||
status = self.configure_device()
|
status = self.configure_device()
|
||||||
if not status:
|
if not status:
|
||||||
@@ -907,13 +921,7 @@ class OpenSKInstaller:
|
|||||||
if status["cert"] and status["pkey"]:
|
if status["cert"] and status["pkey"]:
|
||||||
info("You're all set!")
|
info("You're all set!")
|
||||||
else:
|
else:
|
||||||
info("Your device is not yet configured, and lacks some functionality. "
|
self.print_configure_help()
|
||||||
"If you run into issues, this command might help:\n\n"
|
|
||||||
"./tools/configure.py \\\n"
|
|
||||||
" --certificate=crypto_data/opensk_cert.pem \\\n"
|
|
||||||
" --private-key=crypto_data/opensk.key\n\n"
|
|
||||||
"Please read the Certificate considerations in docs/customization.md"
|
|
||||||
" to understand the privacy trade-off.")
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user