mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
some tools for policy-auto-application
This commit is contained in:
parent
df48e7f73d
commit
ac890ee165
@ -5440,6 +5440,9 @@ sub pandora_process_policy_queue ($) {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Refresh policy agents.
|
||||||
|
enterprise_hook('pandora_apply_policy_groups', [$pa_config, $dbh]);
|
||||||
|
|
||||||
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
|
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
|
||||||
next unless (defined ($operation) && $operation ne '');
|
next unless (defined ($operation) && $operation ne '');
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ our @EXPORT = qw(
|
|||||||
is_offline
|
is_offline
|
||||||
is_empty
|
is_empty
|
||||||
is_in_array
|
is_in_array
|
||||||
|
array_diff
|
||||||
add_hashes
|
add_hashes
|
||||||
to_number
|
to_number
|
||||||
clean_blank
|
clean_blank
|
||||||
@ -714,6 +715,19 @@ sub is_in_array {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Check if a value is in an array
|
||||||
|
################################################################################
|
||||||
|
sub array_diff($$) {
|
||||||
|
my ($a, $b) = @_;
|
||||||
|
|
||||||
|
my %diff;
|
||||||
|
@diff{ @{$a} } = @{$a};
|
||||||
|
delete @diff{ @{$b} };
|
||||||
|
|
||||||
|
return keys %diff;
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Mix hashses
|
# Mix hashses
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user