maas-cli delete non existent zone/network returns nothing

Bug #1286121 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

To reproduce:
$ maas maas zone delete non-existent-zone

Basically you get no output deleting a non existent zone. Perhaps the cli should inform that you can't delete something that doesn't exist similar to the message when you try to delete the default zone.

Tags: api
Revision history for this message
Diogo Matsubara (matsubara) wrote :

The same happens for networks:
$ maas maas network delete non-existent --debug
204 NO CONTENT

  Content-Length: 0
    Content-Type: text/plain
            Date: Fri, 28 Feb 2014 20:03:32 GMT
          Server: Apache/2.4.7 (Ubuntu)
          Status: 204
            Vary: Authorization,Cookie

summary: - maas-cli delete non existent zone returns nothing
+ maas-cli delete non existent zone/network returns nothing
Changed in maas:
status: New → Triaged
importance: Undecided → High
tags: added: api
tags: removed: cli
Revision history for this message
Raphaël Badin (rvb) wrote :

Do we really want to "fix" this? Treating the deletion of a non-existent entity as a success seems grammatically sounds and avoids a lot of nasty concurrency issues in a very elegant way.

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1286121] Re: maas-cli delete non existent zone/network returns nothing

On Sunday 02 Mar 2014 23:46:11 Raphaël Badin wrote:
> Do we really want to "fix" this? Treating the deletion of a non-
> existent entity as a success seems grammatically sounds and avoids a lot
> of nasty concurrency issues in a very elegant way.

Yes, we do. It's up to the client how it treats 404s, not the server.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

HTTP specifies that DELETE should be idempotent. If the thing you want deleted does not exist, that's success. We could return an informational message in the response body, maybe, but the status code should reflect success rather than failure.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi!

We believe this is no longer an issue in the latest MAAS releases. As such, we are marking this bug report as invalid. If you believe this is still an issue, please re-open this back report.

Thanks

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.