Skip to content

Commit

Permalink
[IM] Only display a message is we are filtering and then display the …
Browse files Browse the repository at this point in the history
…appropriate message(s)
  • Loading branch information
barryo committed Dec 15, 2014
1 parent 1f7bda6 commit 54950b7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions application/modules/apiv1/controllers/RouterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,21 @@ public function serverConfAction()
$this->view->irrdbAsns = $this->getD2R( '\\Entities\\IrrdbAsn' )->getForCustomerAndProtocol( $int[ 'cid' ], $proto );
$this->view->asnsProcessed = $asnsProcessed;

// some sanity checks
if( !count( $this->view->prefixes ) && !count( $this->view->irrdbAsns ) )
$this->getLogger()->alert( sprintf( "WARNING: no prefixes and ASNs found for %s/IPv%d in route server config generation",
// some sanity warnings
if( $int['irrdbfilter'] && ( !count( $this->view->prefixes ) || !count( $this->view->irrdbAsns ) ) ) {
if( !count( $this->view->prefixes ) ) {
$this->getLogger()->alert( sprintf( "WARNING: no prefixes found for %s/IPv%d in route server config generation",
$int['cname'], $proto
) );
) );
}

if( !count( $this->view->irrdbAsns ) ) {
$this->getLogger()->alert( sprintf( "WARNING: no ASNs found for %s/IPv%d in route server config generation",
$int['cname'], $proto
) );
}
}

echo $this->view->render( "router-cli/server/{$target}/neighbor.cfg" );
$asnsProcessed[] = $int['autsys'];
}
Expand Down

0 comments on commit 54950b7

Please sign in to comment.