Skip to content

Commit

Permalink
swssconfig: Fix invalid operation handling (sonic-net#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriymoroz-mlnx authored and lguohan committed Dec 7, 2016
1 parent 05bac48 commit 085adc0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swssconfig/swssconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ bool write_db_data(vector<KeyOpFieldsValuesTuple> &db_items)

if (kfvOp(db_item) == SET_COMMAND)
producer.set(key_name, kfvFieldsValues(db_item), SET_COMMAND);
if (kfvOp(db_item) == DEL_COMMAND)
else if (kfvOp(db_item) == DEL_COMMAND)
producer.del(key_name, DEL_COMMAND);
else
{
SWSS_LOG_ERROR("Invalid operation: %s\n", kfvOp(db_item).c_str());
return false;
}
}
return true;
}
Expand Down

0 comments on commit 085adc0

Please sign in to comment.