Skip to content

Commit

Permalink
call reset when remove profile
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Aug 14, 2023
1 parent 33c7a26 commit 0f03ef7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aiidalab_launch/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,19 @@ def add_profile(ctx, app_state, port, home_mount, image, profile):
@click.argument("profile")
@click.option("--yes", is_flag=True, help="Do not ask for confirmation.")
@click.option("-f", "--force", is_flag=True, help="Proceed, ignoring any warnings.")
@click.option("--purge", is_flag=True, help="Remove all data associated with profile.")
@pass_app_state
def remove_profile(app_state, profile, yes, force):
@click.pass_context
def remove_profile(ctx, app_state, profile, yes, force, purge):
"""Remove an AiiDAlab profile from the configuration."""
try:
profile = app_state.config.get_profile(profile)
except ValueError:
raise click.ClickException(f"Profile with name '{profile}' does not exist.")
else:
if purge:
ctx.invoke(reset, profile=profile, yes=yes)

if not force:
instance = AiidaLabInstance(client=app_state.docker_client, profile=profile)
status = asyncio.run(instance.status())
Expand Down

0 comments on commit 0f03ef7

Please sign in to comment.