diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index 6cfc6bc4d563..eeae6b4cb2aa 100644 --- a/orchagent/muxorch.cpp +++ b/orchagent/muxorch.cpp @@ -394,15 +394,14 @@ void MuxCable::setState(string new_state) SWSS_LOG_NOTICE("[%s] Set MUX state from %s to %s", mux_name_.c_str(), muxStateValToString.at(state_).c_str(), new_state.c_str()); - // Update HW Mux cable state anyways - mux_cb_orch_->updateMuxState(mux_name_, new_state); - MuxState ns = muxStateStringToVal.at(new_state); auto it = muxStateTransition.find(make_pair(state_, ns)); if (it == muxStateTransition.end()) { + // Update HW Mux cable state anyways + mux_cb_orch_->updateMuxState(mux_name_, new_state); SWSS_LOG_ERROR("State transition from %s to %s is not-handled ", muxStateValToString.at(state_).c_str(), new_state.c_str()); return; @@ -430,6 +429,7 @@ void MuxCable::setState(string new_state) st_chg_failed_ = false; SWSS_LOG_INFO("Changed state to %s", new_state.c_str()); + mux_cb_orch_->updateMuxState(mux_name_, new_state); return; }