Comment 2 for bug 1829797

Revision history for this message
Tim McNamara (tim-clicks) wrote : Re: [Bug 1829797] [NEW] destroy-controller should prompt for --destroy-all-models and storage options

Failing fast, rather than taking people into the interactive prompt seems
perfectly reasonable.

On Thu, 23 May 2019 at 02:30, Richard Harding <email address hidden>
wrote:

> I'd prefer it just fails fast and says if you still want to do this rerun
> the command with --destroy-all-models vs waiting until after the "Are you
> sure" to check if it can/will do it.
>
> In this way we don't need extra interactive bits to the command.
>
> On Mon, May 20, 2019 at 6:45 PM Tim McNamara <email address hidden>
> wrote:
>
> > Public bug reported:
> >
> > When running juju destroy-controller on a system with live models, Juju
> > aborts after taking users to a prompt. It should either abort
> > immediately or continue the interactive session.
> >
> >
> > Example:
> >
> > juju destroy-controller c-2
> > WARNING! This command will destroy the "c-2" controller.
> > This includes all machines, applications, data and other resources.
> >
> > Continue? (y/N):y
> > Destroying controller
> > ERROR cannot destroy controller "c-2"
> >
> > The controller has live hosted models. If you want
> > to destroy all hosted models in the controller,
> > run this command again with the --destroy-all-models
> > option.
> >
> > Models:
> > admin/default (alive), 2 machines, 1 application
> > admin/misc (alive), 4 machines, 1 application
> >
> >
> > Here is a possible alternative:
> >
> >
> > juju destroy-controller c-2
> > WARNING! This command will destroy the "c-2" controller.
> > This includes all machines, applications, data and other resources.
> >
> > Continue? (y/N):y
> > Destroying controller
> > ERROR cannot destroy controller "c-2"
> >
> > The controller has live hosted models. Do you want
> > to destroy all hosted models? Skip this step by
> > running this command again with the --destroy-all-models
> > option.
> >
> > Models:
> > admin/default (alive), 2 machines, 1 application
> > admin/misc (alive), 4 machines, 1 application
> >
> > Destroy all models? (y/N):y
> >
> >
> > A similar stanza could be made for storage:
> >
> > Destroy storage? (destroy/release/Abort)
> >
> > ** Affects: juju
> > Importance: Low
> > Status: Triaged
> >
> >
> > ** Tags: cli destroy-controller destroy-model usability
> >
> > --
> > You received this bug notification because you are subscribed to juju.
> > https://bugs.launchpad.net/bugs/1829797
> >
> > Title:
> > destroy-controller should prompt for --destroy-all-models and storage
> > options
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/juju/+bug/1829797/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1829797
>
> Title:
> destroy-controller should prompt for --destroy-all-models and storage
> options
>
> Status in juju:
> Triaged
>
> Bug description:
> When running juju destroy-controller on a system with live models,
> Juju aborts after taking users to a prompt. It should either abort
> immediately or continue the interactive session.
>
>
> Example:
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. If you want
> to destroy all hosted models in the controller,
> run this command again with the --destroy-all-models
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
>
> Here is a possible alternative:
>
>
> juju destroy-controller c-2
> WARNING! This command will destroy the "c-2" controller.
> This includes all machines, applications, data and other resources.
>
> Continue? (y/N):y
> Destroying controller
> ERROR cannot destroy controller "c-2"
>
> The controller has live hosted models. Do you want
> to destroy all hosted models? Skip this step by
> running this command again with the --destroy-all-models
> option.
>
> Models:
> admin/default (alive), 2 machines, 1 application
> admin/misc (alive), 4 machines, 1 application
>
> Destroy all models? (y/N):y
>
>
> A similar stanza could be made for storage:
>
> Destroy storage? (destroy/release/Abort)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1829797/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=juju; status=Triaged; importance=Low; assignee=None;
> Launchpad-Bug-Tags: cli destroy-controller destroy-model usability
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: rharding tim-clicks
> Launchpad-Bug-Reporter: Tim McNamara (tim-clicks)
> Launchpad-Bug-Modifier: Richard Harding (rharding)
> Launchpad-Message-Rationale: Subscriber
> Launchpad-Message-For: tim-clicks
>