VOL-3504 Code changes to support force delete
Change-Id: I041ab2101a607b99e0372e432819a3f10f3a774c
diff --git a/rw_core/core/device/agent_port.go b/rw_core/core/device/agent_port.go
index e90a0a4..a3489fc 100644
--- a/rw_core/core/device/agent_port.go
+++ b/rw_core/core/device/agent_port.go
@@ -123,8 +123,9 @@
return err
}
- if device.AdminState != voltha.AdminState_DISABLED && device.AdminState != voltha.AdminState_DELETED {
- err := status.Error(codes.FailedPrecondition, fmt.Sprintf("invalid-state-%v", device.AdminState))
+ if device.AdminState != voltha.AdminState_DISABLED && !agent.isDeletionInProgress() {
+ err := status.Error(codes.FailedPrecondition, fmt.Sprintf("invalid-admin-state-%v",
+ device.AdminState))
logger.Warnw(ctx, "invalid-state-removing-ports", log.Fields{"state": device.AdminState, "error": err})
return err
}