-
Notifications
You must be signed in to change notification settings - Fork 33
[Port Mgr] Support multiple ResourceOperation types #603
Conversation
Codecov Report
@@ Coverage Diff @@
## master #603 +/- ##
============================================
+ Coverage 32.65% 32.75% +0.09%
- Complexity 1241 1248 +7
============================================
Files 522 522
Lines 13093 13117 +24
Branches 1606 1610 +4
============================================
+ Hits 4276 4296 +20
- Misses 8235 8236 +1
- Partials 582 585 +3
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging 4b9573e into a9e3d8b - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
|
||
if (context.containRouters()) { | ||
resourceOperationTypes.add(new ResourceOperation(Common.ResourceType.NEIGHBOR, Common.OperationType.CREATE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resrource type NEIHBOR was already added at line 236, this looks like a duplicate. From the context it looks like resource type ROUTER might be the correct one.
If this is in fact, the correct resource type, a clarifying comment will remove the confusion.
@@ -278,14 +313,15 @@ private void updateNetworkConfig(PortContext context, NetworkConfiguration netwo | |||
networkConfig.setOpType(Common.OperationType.UPDATE); | |||
IRestRequest updateNetworkConfigRequest = | |||
new UpdateNetworkConfigRequest(context, networkConfig); | |||
context.getRequestManager().sendRequestAsync(updateNetworkConfigRequest, request -> portService.updatePortStatus(request,networkConfig,null)); | |||
portService.updatePortStatus(updateNetworkConfigRequest,networkConfig, StatusEnum.PENDING.getStatus()); | |||
context.getRequestManager().sendRequestAsync(updateNetworkConfigRequest, request -> portService.updatePortStatus(request, networkConfig, null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, update doesn't require multiple resource types, then. A comment explicitley stating this fact would be helpful.
In PR #602, a new ResourceOperationType field was added in NetworkConfiguration. This PR sets the value of ResourceOperationTypes when building network configuration and passes down to DPM.