Skip to content

Commit

Permalink
ovn-northd: Refactor logic for logical port 'up' state update
Browse files Browse the repository at this point in the history
No functional change.  Make it obvious that we determine the logical
port 'up' state by checking for bound chassis, and update the NB DB only
when state has not been set yet or current state is different.

Signed-off-by: Jakub Sitnicki <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Mark Michelson <[email protected]>
Acked-by: Miguel Angel Ajo <[email protected]>
  • Loading branch information
Jakub Sitnicki authored and blp committed Nov 28, 2017
1 parent a9e6958 commit 552ffa3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ovn/northd/ovn-northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6205,11 +6205,8 @@ update_logical_port_status(struct northd_context *ctx)
continue;
}

if (sb->chassis && (!nbsp->up || !*nbsp->up)) {
bool up = true;
nbrec_logical_switch_port_set_up(nbsp, &up, 1);
} else if (!sb->chassis && (!nbsp->up || *nbsp->up)) {
bool up = false;
bool up = sb->chassis ? true : false;
if (!nbsp->up || *nbsp->up != up) {
nbrec_logical_switch_port_set_up(nbsp, &up, 1);
}
}
Expand Down

0 comments on commit 552ffa3

Please sign in to comment.