Skip to content

Commit

Permalink
Get rid of a few unnecessary asserts
Browse files Browse the repository at this point in the history
Change-Id: I9e165d91c5c5485e908f44bee41688c52899c2d2
Partial-Bug: 1456193
  • Loading branch information
Nischal Sheth committed May 21, 2015
1 parent f514603 commit 614cdf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/bgp/bgp_config_ifmap.cc
Expand Up @@ -516,7 +516,8 @@ static void GetRoutingInstanceExportTargets(DBGraph *graph, IFMapNode *node,
(GetInstanceTargetRouteTarget(graph, adj, &target))) {
const autogen::InstanceTarget *itarget =
dynamic_cast<autogen::InstanceTarget *>(adj->GetObject());
assert(itarget);
if (!itarget)
continue;
const autogen::InstanceTargetType &itt = itarget->data();
if (itt.import_export != "import")
target_list->push_back(target);
Expand Down Expand Up @@ -632,7 +633,8 @@ void BgpIfmapInstanceConfig::Update(BgpIfmapConfigManager *manager,
if (GetInstanceTargetRouteTarget(graph, adj, &target)) {
const autogen::InstanceTarget *itarget =
dynamic_cast<autogen::InstanceTarget *>(adj->GetObject());
assert(itarget);
if (!itarget)
continue;
const autogen::InstanceTargetType &itt = itarget->data();
if (itt.import_export == "import") {
import_list.insert(target);
Expand Down Expand Up @@ -1332,7 +1334,9 @@ void BgpIfmapConfigManager::ProcessBgpPeering(const BgpConfigDelta &delta) {
event = BgpConfigManager::CFG_ADD;
string instance_name(IdentifierParent(routers.first->name()));
BgpIfmapInstanceConfig *rti = config_->FindInstance(instance_name);
assert(rti != NULL);
if (rti == NULL) {
return;
}
peering = config_->CreatePeering(rti, proxy);
} else {
const IFMapNode *node = peering->node();
Expand Down
4 changes: 2 additions & 2 deletions src/bgp/routing-instance/routing_instance.cc
Expand Up @@ -316,7 +316,7 @@ void RoutingInstanceMgr::UpdateRoutingInstance(
RTINSTANCE_LOG_MESSAGE(server_,
SandeshLevel::SYS_WARN, RTINSTANCE_LOG_FLAG_ALL, config->name(),
"Instance not found during update");
assert(rtinstance != NULL);
return;
}

InstanceTargetRemove(rtinstance);
Expand Down Expand Up @@ -363,7 +363,7 @@ void RoutingInstanceMgr::DeleteRoutingInstance(const string &name) {
RTINSTANCE_LOG_MESSAGE(server_,
SandeshLevel::SYS_WARN, RTINSTANCE_LOG_FLAG_ALL, name,
"Instance not found during delete");
assert(rtinstance != NULL);
return;
}

InstanceVnIndexRemove(rtinstance);
Expand Down

0 comments on commit 614cdf5

Please sign in to comment.