Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Get rid of a few unnecessary asserts
Change-Id: I9e165d91c5c5485e908f44bee41688c52899c2d2
Partial-Bug: 1456193
  • Loading branch information
Nischal Sheth committed May 21, 2015
1 parent b4e01e8 commit 1b7e171
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.cc
Expand Up @@ -503,7 +503,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 @@ -583,7 +584,8 @@ void BgpInstanceConfig::Update(BgpConfigManager *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 @@ -1179,7 +1181,9 @@ void BgpConfigManager::ProcessBgpPeering(const BgpConfigDelta &delta) {
event = BgpConfigManager::CFG_ADD;
string instance_name(IdentifierParent(routers.first->name()));
BgpInstanceConfig *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 @@ -315,7 +315,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 @@ -362,7 +362,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 1b7e171

Please sign in to comment.