Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/switch-template-bounce #5735

Merged
merged 10 commits into from
Sep 16, 2020
Merged

feature/switch-template-bounce #5735

merged 10 commits into from
Sep 16, 2020

Conversation

jrouzierinverse
Copy link
Member

@jrouzierinverse jrouzierinverse commented Aug 6, 2020

Description

Template based bouncePort

NEWS file entries

Enhancements

  • Template based bouncePort

Issue

fixes #5633

Delete branch after merge

NO

Checklist

  • Document the feature
  • Add unit tests
  • Add acceptance tests (TestLink)

@lyubomirtraykov
Copy link
Contributor

lyubomirtraykov commented Aug 7, 2020

I think it will be better if we don't use the locationlog to determine the mac of the node, but to pass the mac as argument in:
html/pfappserver/lib/pfappserver/Model/Node.pm - sub restartSwitchport
lib/pf/UnifiedApi/Controller/Nodes.pm - sub do_restart_switchport
lib/pf/api.pm - sub _reassignSNMPConnections

@@ -474,17 +474,18 @@ sub bouncePort {
return $TRUE;
}

return $self->_bouncePortCoa($ifindex);
my $radiusBounce = $self->{_template}{bounce};
if (!defined $radiusBounce) {
Copy link
Contributor

@lyubomirtraykov lyubomirtraykov Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add isenabled($self->{_template}->{snmpDisconnect}) in the if

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I add that in the if statement it would be a logical error.
Since I am expecting radiusBounce to be defined here https://github.com/inverse-inc/packetfence/pull/5735/files#diff-e7181847796bf1ef221178bfd4822927R483

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but if you enable snmpDisconnect and add bounce in the template configuration, the disconnection method will call handleReAssignVlanTrapForWiredMacAuth which uses bouncePort and then it will preform COA not SNMP.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the better explanation of the issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the least surprise.
If you define bounce attributes we will use that when performing a bounce.
If you enable snmpDisconnect then we will use SNMP to disconnect.
It is the responsibility of the person configuring the Template Switch to choose the behavior they want.

I pushed the code to do this.

@jrouzierinverse
Copy link
Member Author

I think it will be better if we don't use the locationlog to determine the mac of the node, but to pass the mac as argument in:
html/pfappserver/lib/pfappserver/Model/Node.pm - sub restartSwitchport
lib/pf/UnifiedApi/Controller/Nodes.pm - sub do_restart_switchport
lib/pf/api.pm - sub _reassignSNMPConnections

That makes sense I would need to review the case of VOIP.

@lyubomirtraykov
Copy link
Contributor

lyubomirtraykov commented Aug 11, 2020

@jrouzierinverse i tested passing the mac as argument and everything is working as it should. So i think we should use the argument method instead of locationlog.

@nqb nqb self-assigned this Sep 9, 2020
@nqb
Copy link
Contributor

nqb commented Sep 14, 2020

LGTM, I will push minor adjustements to documentation before I merged.

Copy link
Contributor

@nqb nqb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last thing I noticed @jrouzierinverse during my review of Switch Template's documentation is that following syntax: VendorName:Attribute-Name1 = value1 is not valid anymore. If you use a Vendor attribute in GUI, resulting attribute is written like any other.

@extrafu
Copy link
Member

extrafu commented Sep 15, 2020

@nqb & @jrouzierinverse what are we doing based on Nicolas' last comment?

@nqb nqb merged commit c519252 into devel Sep 16, 2020
nqb added a commit that referenced this pull request Sep 16, 2020
satkunas pushed a commit that referenced this pull request Dec 11, 2020
@satkunas satkunas deleted the feature/switch-template-bounce branch May 15, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restart Switchport with COA
4 participants