From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 66F4B62A9E for ; Mon, 21 Dec 2020 15:25:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A57620C43 for ; Mon, 21 Dec 2020 15:25:26 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 4169D20C33 for ; Mon, 21 Dec 2020 15:25:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 073E145536 for ; Mon, 21 Dec 2020 15:25:25 +0100 (CET) Message-ID: <46039410-6f9f-80da-8508-d48ffec96670@proxmox.com> Date: Mon, 21 Dec 2020 15:25:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0 Content-Language: en-GB To: Proxmox VE development discussion , Aaron Lauterer References: <20201221100754.2912-1-a.lauterer@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20201221100754.2912-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.064 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] applied: Re: [PATCH v2 manager] pveceph: change status from long JSON to ceph -s X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2020 14:25:56 -0000 On 21/12/2020 11:07, Aaron Lauterer wrote: > Printing a lot of very detailed JSON output on the CLI is not very > useful. > > Printing the `ceph -s` overview is much more suited to give an overview > of the ceph cluster status. > > Signed-off-by: Aaron Lauterer > --- > v1 -> v2: > * added check if Ceph is iniated to avoid ugly error msg good idea > * removed eval (if the command fails, we want to see the error msg) > * code style: avoiding long lines > > @thomas thx for the hint in the dev guidelines regarding long lines. > somehow I missed that until now and took the surrounding (older) code as > guideline :) > please also add a trailing comma to the last argument when doing all arguments on separate lines - at least if they're a "eats all" param hash or array, avoids the need to change multiple lines when adding or removing an argument. We may add a more specific rule for that though. > > PVE/CLI/pveceph.pm | 26 +++++++++++++++++++++----- > 1 file changed, 21 insertions(+), 5 deletions(-) > > applied, thanks! Added a timeout of 15s (chose by gut feeling) to the run_command, as ceph -s hangs indefinitely if it cannot reach any monitor (and/or other ceph service).