dyndns2: Wrap long list of group by attributes

This commit is contained in:
Richard Hansen 2024-07-13 04:52:05 -04:00
parent 90de2f9606
commit 1e73f4a51a

View file

@ -4050,7 +4050,6 @@ EoEXAMPLE
###################################################################### ######################################################################
sub nic_dyndns2_update { sub nic_dyndns2_update {
debug("\nnic_dyndns2_update -------------------"); debug("\nnic_dyndns2_update -------------------");
my @groups = group_hosts_by(\@_, qw(login password server script static custom wildcard mx backupmx wantipv4 wantipv6));
my %errors = ( my %errors = (
'badauth' => 'Bad authorization (username or password)', 'badauth' => 'Bad authorization (username or password)',
'badsys' => 'The system parameter given was not valid', 'badsys' => 'The system parameter given was not valid',
@ -4064,7 +4063,20 @@ sub nic_dyndns2_update {
'dnserr' => 'System error: DNS error encountered. Contact support@dyndns.org', 'dnserr' => 'System error: DNS error encountered. Contact support@dyndns.org',
'nochg' => 'No update required; unnecessary attempts to change to the current address are considered abusive', 'nochg' => 'No update required; unnecessary attempts to change to the current address are considered abusive',
); );
for my $group (@groups) { my @group_by_attrs = qw(
backupmx
custom
login
mx
password
script
server
static
wantipv4
wantipv6
wildcard
);
for my $group (group_hosts_by(\@_, @group_by_attrs)) {
my @hosts = @{$group->{hosts}}; my @hosts = @{$group->{hosts}};
my %groupcfg = %{$group->{cfg}}; my %groupcfg = %{$group->{cfg}};
my $hosts = join(',', @hosts); my $hosts = join(',', @hosts);