@@ -238,27 +238,27 @@ def remove_profile(ctx, app_state, profile, yes, force, purge):
238238 profile = app_state .config .get_profile (profile )
239239 except ValueError :
240240 raise click .ClickException (f"Profile with name '{ profile } ' does not exist." )
241- else :
242- if not force :
243- instance = AiidaLabInstance (client = app_state .docker_client , profile = profile )
244- status = asyncio .run (instance .status ())
245- if status not in (
246- instance .AiidaLabInstanceStatus .DOWN ,
247- instance .AiidaLabInstanceStatus .CREATED ,
248- instance .AiidaLabInstanceStatus .EXITED ,
249- ):
250- raise click .ClickException (
251- f"The instance associated with profile '{ profile .name } ' "
252- "is still running. Use the -f/--force option to remove the "
253- "profile anyways."
254- )
255241
256- if yes or click .confirm (
257- f"Are you sure you want to remove profile '{ profile .name } '?"
242+ if not force :
243+ instance = AiidaLabInstance (client = app_state .docker_client , profile = profile )
244+ status = asyncio .run (instance .status ())
245+ if status not in (
246+ instance .AiidaLabInstanceStatus .DOWN ,
247+ instance .AiidaLabInstanceStatus .CREATED ,
248+ instance .AiidaLabInstanceStatus .EXITED ,
258249 ):
259- app_state .config .profiles .remove (profile )
260- app_state .save_config ()
261- click .echo (f"Removed profile with name '{ profile .name } '." )
250+ raise click .ClickException (
251+ f"The instance associated with profile '{ profile .name } ' "
252+ "is still running. Use the -f/--force option to remove the "
253+ "profile anyways."
254+ )
255+
256+ if yes or click .confirm (
257+ f"Are you sure you want to remove profile '{ profile .name } '?"
258+ ):
259+ app_state .config .profiles .remove (profile )
260+ app_state .save_config ()
261+ click .echo (f"Removed profile with name '{ profile .name } '." )
262262
263263 if purge :
264264 ctx .invoke (reset , profile = profile , yes = yes )
@@ -701,7 +701,7 @@ def reset(app_state, profile, yes):
701701 )
702702
703703 click .secho (
704- f"Resetting instance for profile '{ profile .name } '. This action cannot be undone!" ,
704+ f"Resetting instance for profile '{ profile .name } '. It will remove ALL DATA, the docker container and the volumes associated. This action cannot be undone!" ,
705705 err = True ,
706706 fg = "red" ,
707707 )
0 commit comments