Merge lp:~jason-jasonamyers/maas/clearer-msg-for-api-204-returns into lp:maas/trunk
| Status: | Merged |
|---|---|
| Approved by: | Raphaël Badin on 2015-01-09 |
| Approved revision: | 3442 |
| Merged at revision: | 3441 |
| Proposed branch: | lp:~jason-jasonamyers/maas/clearer-msg-for-api-204-returns |
| Merge into: | lp:maas/trunk |
| Diff against target: |
39 lines (+5/-3) 2 files modified
src/maascli/api.py (+1/-1) src/maascli/tests/test_api.py (+4/-2) |
| To merge this branch: | bzr merge lp:~jason-jasonamyers/maas/clearer-msg-for-api-204-returns |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Raphaël Badin (community) | Approve on 2015-01-08 | ||
|
Review via email:
|
|||
Commit Message
Prints the word Success on receiving a http code of 20X from any API based command via maas-cli.
Description of the Change
Prints the word Success on receiving a http code of 20X from any API based command via maas-cli
| Raphaël Badin (rvb) wrote : | # |
| jasonamyers (jason-jasonamyers) wrote : | # |
so would you like to print the line "Machine-readable output follows:\n"
even if there isn't going to be content like with a 204?
Thanks,
Jason
On Wed, Jan 7, 2015 at 3:49 AM, Raphaël Badin <email address hidden>
wrote:
> Thanks for the fix Jason!
>
> Looks generally good but I think we could do a more general fix by
> printing "Success" for all the 20X responses.
>
> In other words I suggest changing the check above the line you've changed
> ("response.status == 200") to deal with all 20X response codes instead of
> adding a new condition and modify the test that you've added accordingly
> (you should probably merge it with
> test_print_
> generate 20X response codes).
> --
>
> https:/
> You are the owner of
> lp:~jason-jasonamyers/maas/clearer-msg-for-api-204-returns.
>
| Raphaël Badin (rvb) wrote : | # |
> so would you like to print the line "Machine-readable output follows:\n"
> even if there isn't going to be content like with a 204?
>
> Thanks,
> Jason
Yeah, I think that's fine. Even a 200 response could have an empty response. As you pointed out, a 204 response is guaranteed to have an empty response but the textual output has to be clear and simple for human user. The information that the content is empty might be useful (even if the response is a 204).
- 3441. By jasonamyers on 2015-01-07
-
Changing code to print a Success message on any HTTP status code of 20X, and updated test to use a random HTTP status code between 200 and 209
| Raphaël Badin (rvb) wrote : | # |
Thanks for all the changes. I think this is good to land now. Please just have a look at my remark about how you to check for success error codes. Once this is fixed you can mark the MP approved and the lander will take care of the rest.
- 3442. By jasonamyers on 2015-01-08
-
Expanding the range from 20X to any HTTP 200 series status code.


Thanks for the fix Jason!
Looks generally good but I think we could do a more general fix by printing "Success" for all the 20X responses.
In other words I suggest changing the check above the line you've changed ("response.status == 200") to deal with all 20X response codes instead of adding a new condition and modify the test that you've added accordingly (you should probably merge it with test_print_ response_ prints_ textual_ response_ with_success_ msg and randomly generate 20X response codes).