public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Max Carrara <m.carrara@proxmox.com>
Subject: [pve-devel] applied: [PATCH manager v2] fix #4364: pveceph: add confirmation dialogue for ceph installation
Date: Thu, 6 Jul 2023 16:10:34 +0200	[thread overview]
Message-ID: <cbc01909-e588-cadc-d767-14aef7d26d0f@proxmox.com> (raw)
In-Reply-To: <20230705180240.300150-1-m.carrara@proxmox.com>

Am 05/07/2023 um 20:02 schrieb Max Carrara:
> Displays a confirmation dialogue if the user didn't explicitly
> provide a valid ceph version via the `--version` flag and if
> stdout is connected to a tty.
> 
> Signed-off-by: Max Carrara <m.carrara@proxmox.com>
> ---
> 
> v2 of this little patch incorporates the given feedback[0] (thanks btw!)
> 
> Regarding exit codes: Even though it's not too important, I think we
> should stick with a non-zero exit code here; at least from what I've
> encountered, installation wizards or similar will only exit with 0
> if the installation succeeded *or* if the thing to be installed is
> already installed. That way subsequent commands are only executed if
> the things to be installed are actually there, as further commands
> *might* already depend on them, e.g.:
> 
>   apt-get install -y neofetch && neofetch
> 
>   pveceph install --version quincy && ceph status
> 

besides that those example would not really change if the first command
exits with 0 even if not installed, as the second would simply fail leaving
the result of the boolean expression the same, the question wasn't about
non-interactive batch-mode, there it definitively is correct to exit with
non-zereo, what I did is questioning the *interactive* abort by user choice.

While one might reach the same conclusion also for that too, above
argumentation is IMO not enough to justify that (on its own).

But FWIW, "apt purge" or "apt full-upgrade" also exit with non-zero if one
answers the confirmation with no (albeit, just for completeness sake, there
the default answer is Y).

> This is mostly philosophical, but I've personally found that behaviour
> useful in some situations.
> > 
> [0]: https://lists.proxmox.com/pipermail/pve-devel/2023-July/057993.html
> 
> 
>  PVE/CLI/pveceph.pm | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
>

applied, thanks!

Bonus points if you add checking the broadcasted ceph-versions using
PVE::Ceph::Services::get_ceph_versions() and if there are any and (all of?) them
match the default one, just continue.

And respective then for the "version got passed explicitly but mismatches with
what seems to be installed on other nodes" case you could also ask for confirmation
if on a TTY (no TTY one is likely to stem from the web UI, where the user got that
info already anyway, and installing newer version while an older one is still in
use can be fine too, so wouldn't ever hard-block that case).




      reply	other threads:[~2023-07-06 14:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 18:02 [pve-devel] " Max Carrara
2023-07-06 14:10 ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cbc01909-e588-cadc-d767-14aef7d26d0f@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.carrara@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal