From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 549BF1FF38C for ; Thu, 16 May 2024 11:45:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B100433D7E; Thu, 16 May 2024 11:46:07 +0200 (CEST) Date: Thu, 16 May 2024 11:45:29 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20240515103213.455567-1-a.lauterer@proxmox.com> <20240515103213.455567-3-a.lauterer@proxmox.com> In-Reply-To: <20240515103213.455567-3-a.lauterer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1715852270.debtfaacfe.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.055 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH cluster 2/2] pvecm: qdevice: adjust line lengths 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On May 15, 2024 12:32 pm, Aaron Lauterer wrote: > The first instance had the line break mid array. It now is a bit over > the limit, but follows the style guide closely: putting each argument to > the function in a newline. > > Signed-off-by: Aaron Lauterer > --- > src/PVE/CLI/pvecm.pm | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/src/PVE/CLI/pvecm.pm b/src/PVE/CLI/pvecm.pm > index 5c285a9..53e9cac 100755 > --- a/src/PVE/CLI/pvecm.pm > +++ b/src/PVE/CLI/pvecm.pm > @@ -210,10 +210,10 @@ __PACKAGE__->register_method ({ > my ($node, $ip) = @_; > my $ssh_options = PVE::SSHInfo::ssh_info_to_ssh_opts ({ ip => $ip, name => $node }); > my $outsub = sub { print "\nnode '$node': " . shift }; > - run_command([ > - @$ssh_cmd, @$ssh_options, $ip, "$qdevice_certutil", "-m", "-c", > - "/etc/pve/$p12_file_base"], outfunc => \&$outsub > - ); > + run_command( > + [@$ssh_cmd, @$ssh_options, $ip, "$qdevice_certutil", "-m", "-c", "/etc/pve/$p12_file_base"], > + outfunc => \&$outsub this would then be even shorter if the options can be dropped altogether. and while we are at it: outfunc => $outsub no need for symbol salad here :) I don't mind the arg-per-line even if it would be below the limit then, but as an alternative, you can always construct the full command first to make the run_command line shorter. e.g.: my $cluster_ssh_cmd = PVE::SSHInfo::ssh_info_to_command({ ip => $ip, name => $node }); my $cmd = [@$cluster_ssh_cmd, '--', $qdevice_certutil, '-m', '-c', "/etc/pve/$p12_file_base"]; run_command($cmd, outfunc => $outsub); but that is mainly a matter of taste I'd say. > + ); > }); > unlink "/etc/pve/$p12_file_base"; > > @@ -249,8 +249,14 @@ __PACKAGE__->register_method ({ > my $ssh_options = PVE::SSHInfo::ssh_info_to_ssh_opts ({ ip => $ip, name => $node }); > my $outsub = sub { print "\nnode '$node': " . shift }; > print "\nINFO: start and enable corosync qdevice daemon on node '$node'...\n"; > - run_command([@$ssh_cmd, @$ssh_options, $ip, 'systemctl', 'start', 'corosync-qdevice'], outfunc => \&$outsub); > - run_command([@$ssh_cmd, @$ssh_options, $ip, 'systemctl', 'enable', 'corosync-qdevice'], outfunc => \&$outsub); > + run_command( > + [@$ssh_cmd, @$ssh_options, $ip, 'systemctl', 'start', 'corosync-qdevice'], > + outfunc => \&$outsub > + ); > + run_command( > + [@$ssh_cmd, @$ssh_options, $ip, 'systemctl', 'enable', 'corosync-qdevice'], > + outfunc => \&$outsub > + ); same as above applies here as well > }); > > run_command(['corosync-cfgtool', '-R']); # do cluster wide config reload > -- > 2.39.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel