Skip to content

Commit 4d8db39

Browse files
committed
[ppi]: Handle review comments.
Signed-off-by: Nazarii Hnydyn <[email protected]>
1 parent ea5077a commit 4d8db39

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

orchagent/port/porthlpr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ bool PortHelper::validatePortConfig(PortConfig &port) const
931931

932932
if (!port.admin_status.is_set)
933933
{
934-
SWSS_LOG_NOTICE(
934+
SWSS_LOG_INFO(
935935
"Missing non mandatory field(%s): setting default value(%s)",
936936
PORT_ADMIN_STATUS,
937937
PORT_STATUS_DOWN

orchagent/portsorch.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,11 @@ void PortsOrch::setPortConfigState(port_config_state_t value)
683683

684684
bool PortsOrch::addPortBulk(const std::vector<PortConfig> &portList)
685685
{
686+
// The method is used to create ports in a bulk mode.
687+
// The action takes place when:
688+
// 1. Ports are being initialized at system start
689+
// 2. Ports are being added/removed by a user at runtime
690+
686691
SWSS_LOG_ENTER();
687692

688693
if (portList.empty())
@@ -4036,6 +4041,15 @@ void PortsOrch::doPortTask(Consumer &consumer)
40364041
}
40374042
else if (op == DEL_COMMAND)
40384043
{
4044+
Port p;
4045+
if (!getPort(pCfg.key, p))
4046+
{
4047+
SWSS_LOG_ERROR("Failed to remove port: alias %s doesn't exist", pCfg.key.c_str());
4048+
m_portConfigMap.erase(pCfg.key);
4049+
it = taskMap.erase(it);
4050+
continue;
4051+
}
4052+
40394053
const auto &alias = pCfg.key;
40404054

40414055
if (m_port_ref_count[alias] > 0)

0 commit comments

Comments
 (0)