Skip to content

Commit

Permalink
Merge pull request #529 from Nitrokey/stable-factory-reset
Browse files Browse the repository at this point in the history
factory-reset(-app): remove --experimental flag
  • Loading branch information
sosthene-nitrokey committed Apr 16, 2024
2 parents bd61327 + 592e1f4 commit f3f019d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pynitrokey/cli/nk3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pynitrokey.cli import trussed
from pynitrokey.cli.exceptions import CliException
from pynitrokey.cli.trussed.test import TestCase
from pynitrokey.helpers import check_experimental_flag
from pynitrokey.helpers import local_print
from pynitrokey.nk3 import NK3_DATA
from pynitrokey.nk3.bootloader import Nitrokey3Bootloader
from pynitrokey.nk3.device import Nitrokey3Device
Expand Down Expand Up @@ -112,7 +112,9 @@ def update(
"""

if experimental:
"The --experimental switch is not required to run this command anymore and can be safely removed."
local_print(
"The --experimental switch is not required to run this command anymore and can be safely removed."
)

from .update import update as exec_update

Expand Down Expand Up @@ -243,7 +245,12 @@ def set_config(ctx: Context, key: str, value: str, force: bool, dry_run: bool) -
)
def factory_reset(ctx: Context, experimental: bool) -> None:
"""Factory reset all functionality of the device"""
check_experimental_flag(experimental)

if experimental:
local_print(
"The --experimental switch is not required to run this command anymore and can be safely removed."
)

with ctx.connect_device() as device:
device.admin.factory_reset()

Expand All @@ -264,7 +271,12 @@ def factory_reset(ctx: Context, experimental: bool) -> None:
)
def factory_reset_app(ctx: Context, application: str, experimental: bool) -> None:
"""Factory reset all functionality of an application"""
check_experimental_flag(experimental)

if experimental:
local_print(
"The --experimental switch is not required to run this command anymore and can be safely removed."
)

with ctx.connect_device() as device:
device.admin.factory_reset_app(application)

Expand Down

0 comments on commit f3f019d

Please sign in to comment.