Skip to content

Commit

Permalink
trigger the violation before deregister
Browse files Browse the repository at this point in the history
  • Loading branch information
fdurand committed Nov 27, 2019
1 parent 01a9fb1 commit b5120b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pf/node.pm
Original file line number Diff line number Diff line change
Expand Up @@ -766,16 +766,16 @@ sub nodes_maintenance {
while (my $row = $iter->next()) {
my $currentMac = $row->{mac};
pf::dal->set_tenant($row->{tenant_id});
node_deregister($currentMac);

my $apiclient = pf::client::getClient;

my $apiclient = pf::client::getClient;
my %violation_data = (
'mac' => $currentMac,
'tid' => 'node_maintenance',
'type' => 'internal',
);
$apiclient->notify('trigger_violation', %violation_data);
$apiclient->call('trigger_violation', %violation_data);

node_deregister($currentMac);

require pf::enforcement;
pf::enforcement::reevaluate_access( $currentMac, 'manage_deregister' );
Expand Down

0 comments on commit b5120b2

Please sign in to comment.