-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of successful del-network #3458
Fix handling of successful del-network #3458
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3458 +/- ##
============================================
- Coverage 73.13% 73.09% -0.04%
- Complexity 23787 23830 +43
============================================
Files 2062 2073 +11
Lines 99540 99747 +207
Branches 11935 11946 +11
============================================
+ Hits 72800 72912 +112
- Misses 21416 21493 +77
- Partials 5324 5342 +18
|
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @agember)
projects/batfish-client/src/main/java/org/batfish/client/BfCoordWorkHelper.java, line 252 at r1 (raw file):
.delete(); if (response.getStatus() != Status.OK.getStatusCode()) {
Nice catch!
It looks like this is entirely the wrong paradigm, and this should be:
if (response.getStatus().getFamily() != Family.SUCCESSFUL) {
(See: https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Response.Status.html#getFamily--)
Then, the code will be robust to minor output changes on the server side that are still within contract. Would you make that change?
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.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Running
del-network
when a network exists returns 200 OK not 204 OK. Thus, an error message should only be printed if the status code is not 200 OK.