Skip to content

Commit

Permalink
Merge pull request #464 from jonstout/default-dpid
Browse files Browse the repository at this point in the history
Using mgmt_address as the dpid for netconf only nodes
  • Loading branch information
ajragusa authored Aug 10, 2017
2 parents bfeb832 + e6accad commit ad2cea2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions perl-lib/OESS/lib/OESS/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7740,8 +7740,9 @@ sub create_node_instance{
}
}

if(!defined($args{'dpid'})){
$args{'dpid'} = inet_aton($args{'mgmt_addr'});
if (!defined $args{'dpid'}) {
my $data = inet_aton($args{'mgmt_addr'});
$args{'dpid'} = unpack('N', $data);
}

my $res = $self->_execute_query("insert into node_instantiation (node_id,end_epoch,start_epoch,mgmt_addr,admin_state,dpid,vendor,model,sw_version,mpls,openflow ) VALUES (?,?,?,?,?,?,?,?,?,?,?)",[$args{'node_id'},-1,time(),$args{'mgmt_addr'},$args{'admin_state'},$args{'dpid'},$args{'vendor'},$args{'model'},$args{'sw_version'},$args{'mpls'},$args{'openflow'}]);
Expand Down

0 comments on commit ad2cea2

Please sign in to comment.