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;
|
||||
}
|
||||
|
||||
# Refresh policy agents.
|
||||
enterprise_hook('pandora_apply_policy_groups', [$pa_config, $dbh]);
|
||||
|
||||
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
|
||||
next unless (defined ($operation) && $operation ne '');
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@ our @EXPORT = qw(
|
|||
is_offline
|
||||
is_empty
|
||||
is_in_array
|
||||
array_diff
|
||||
add_hashes
|
||||
to_number
|
||||
clean_blank
|
||||
|
@ -714,6 +715,19 @@ sub is_in_array {
|
|||
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
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue