ONOS-7509 preserve all attributes when ensuring enabled state

- it seemed deleted flag was lost due to old code.

Change-Id: I0abb22835318f2e165bbf23fa2978b601d563be1
This commit is contained in:
Yuta HIGUCHI 2018-03-01 21:41:06 -08:00 committed by Ray Milkey
parent 620655b7f8
commit 2b1935d824
2 changed files with 7 additions and 10 deletions

View File

@ -133,11 +133,10 @@ public final class OpticalPortOperator implements PortConfigOperator {
// result is no-op
return descr;
}
return new DefaultPortDescription(port,
descr.isEnabled(),
descr.type(),
descr.portSpeed(),
sa);
return DefaultPortDescription.builder(descr)
.withPortNumer(port)
.annotations(sa)
.build();
}
/**

View File

@ -568,11 +568,9 @@ public class DeviceManager
private PortDescription ensurePortEnabledState(PortDescription desc, boolean enabled) {
if (desc.isEnabled() != enabled) {
return new DefaultPortDescription(desc.portNumber(),
enabled,
desc.type(),
desc.portSpeed(),
desc.annotations());
return DefaultPortDescription.builder(desc)
.isEnabled(enabled)
.build();
}
return desc;
}