Skip to content

Commit

Permalink
remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Dec 10, 2024
1 parent 7779505 commit 33a598a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
18 changes: 1 addition & 17 deletions logic/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,6 @@ func IsUserAllowedToCommunicate(userName string, peer models.Node) (bool, []mode

// IsNodeAllowedToCommunicate - check node is allowed to communicate with the peer
func IsNodeAllowedToCommunicate(node, peer models.Node) (bool, []models.Acl) {
if node.ID.String() == "6901219b-9bee-412a-aa2a-4911c8387a6d" &&
peer.IsStatic && peer.StaticNode.ClientID == "cool-sky" {
fmt.Println("\n\n=========================================\n\n")
defer fmt.Println("\n\n=========================================\n\n")
fmt.Printf("=====> NODE: %s, Peer: %s", node.ID.String(), peer.ID.String())
}

if node.IsStatic {
node = node.StaticNode.ConvertToStaticNode()
Expand All @@ -604,13 +598,6 @@ func IsNodeAllowedToCommunicate(node, peer models.Node) (bool, []models.Acl) {
}
srcMap := convAclTagToValueMap(policy.Src)
dstMap := convAclTagToValueMap(policy.Dst)
if node.ID.String() == "6901219b-9bee-412a-aa2a-4911c8387a6d" &&
peer.IsStatic && peer.StaticNode.ClientID == "cool-sky" {
fmt.Printf("\n======> SRCMAP: %+v\n", srcMap)
fmt.Printf("\n======> DSTMAP: %+v\n", dstMap)
fmt.Printf("\n======> node Tags: %+v\n", node.Tags)
fmt.Printf("\n======> peer Tags: %+v\n", peer.Tags)
}
for tagID := range node.Tags {
allowed := false
if _, ok := dstMap[tagID.String()]; policy.AllowedDirection == models.TrafficDirectionBi && ok {
Expand Down Expand Up @@ -688,10 +675,7 @@ func IsNodeAllowedToCommunicate(node, peer models.Node) (bool, []models.Acl) {
}
}
}
if node.ID.String() == "6901219b-9bee-412a-aa2a-4911c8387a6d" &&
peer.IsStatic && peer.StaticNode.ClientID == "cool-sky" {
fmt.Printf("====> ALLOWED POLICIES: %+v", allowedPolicies)
}

if len(allowedPolicies) > 0 {
return true, allowedPolicies
}
Expand Down
4 changes: 0 additions & 4 deletions logic/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
hostPeerUpdate.FwUpdate.AllowAll = false
}
hostPeerUpdate.FwUpdate.AclRules = GetAclRulesForNode(&node)
if host.Name == "lon-1" {
fmt.Println("##### DEF POL ", defaultDevicePolicy.Enabled, defaultUserPolicy.Enabled)
fmt.Printf("ACL Rules: %+v\n", hostPeerUpdate.FwUpdate.AclRules)
}
currentPeers := GetNetworkNodesMemory(allNodes, node.Network)
for _, peer := range currentPeers {
peer := peer
Expand Down

0 comments on commit 33a598a

Please sign in to comment.