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

[aclorch]: Revise ACL rule creation/removal logs #1042

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,19 +1498,22 @@ bool AclTable::add(shared_ptr<AclRule> newRule)
if (ruleIter->second->remove())
{
rules.erase(ruleIter);
SWSS_LOG_NOTICE("Successfully deleted ACL rule: %s", rule_id.c_str());
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
}
}

if (newRule->create())
{
rules[rule_id] = newRule;
SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s", rule_id.c_str(), id.c_str());
SWSS_LOG_NOTICE("Successfully created ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
return true;
}
else
{
SWSS_LOG_ERROR("Failed to create rule in table %s", id.c_str());
SWSS_LOG_ERROR("Failed to create ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
return false;
}
}
Expand All @@ -1525,18 +1528,21 @@ bool AclTable::remove(string rule_id)
if (ruleIter->second->remove())
{
rules.erase(ruleIter);
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s", rule_id.c_str());
SWSS_LOG_NOTICE("Successfully deleted ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
return true;
}
else
{
SWSS_LOG_ERROR("Failed to delete ACL rule: %s", rule_id.c_str());
SWSS_LOG_ERROR("Failed to delete ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
return false;
}
}
else
{
SWSS_LOG_WARN("Skip deleting ACL rule. Unknown rule %s", rule_id.c_str());
SWSS_LOG_WARN("Skip deleting unknown ACL rule %s in table %s",
rule_id.c_str(), id.c_str());
return true;
}
}
Expand All @@ -1551,7 +1557,8 @@ bool AclTable::clear()
bool suc = rule.remove();
if (!suc)
{
SWSS_LOG_ERROR("Failed to delete existing ACL rule %s when removing the ACL table %s", rule.getId().c_str(), id.c_str());
SWSS_LOG_ERROR("Failed to delete ACL rule %s when removing the ACL table %s",
rule.getId().c_str(), id.c_str());
return false;
}
}
Expand Down