api v2 update_recordset works improperly when updating 'records'

Bug #1412539 reported by stanzgy
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Critical
stanzgy

Bug Description

See examples below.
Here is a type A recordsets "www.example.net." with records 10.0.0.1 and 10.0.0.2. I want to update records to 10.0.0.3 but got 10.0.0.2 and 10.0.0.3.

$ curl -g -X GET -H "X-Auth-Token: 59abb39c9b114196acc60c31b03b6c86" http://10.180.64.22:9001/v2/zones/bc49118c-405d-4497-a567-76ba1b3cacd9/recordsets/e702d7c1-c437-4f34-88a3-237d942a53fc

{
    "recordset": {
        "created_at": "2015-01-19T18:10:12.000000",
        "description": null,
        "id": "e702d7c1-c437-4f34-88a3-237d942a53fc",
        "links": {
            "self": "http://10.180.64.22:9001/v2/zones/bc49118c-405d-4497-a567-76ba1b3cacd9/recordsets/e702d7c1-c437-4f34-88a3-237d942a53fc"
        },
        "name": "www.example.net.",
        "records": [
            "10.0.0.1",
            "10.0.0.2"
        ],
        "ttl": null,
        "type": "A",
        "updated_at": null,
        "version": 1,
        "zone_id": "bc49118c-405d-4497-a567-76ba1b3cacd9"
    }
}

$ curl -g -X PUT -H "X-Auth-Token: 59abb39c9b114196acc60c31b03b6c86" http://10.180.64.22:9001/v2/zones/bc49118c-405d-4497-a567-76ba1b3cacd9/recordsets/e702d7c1-c437-4f34-88a3-237d942a53fc -H "Content-Type: application/json" -d '{"recordset" : {"records" : ["10.0.0.3"]}}'

{
    "recordset": {
        "created_at": "2015-01-19T18:10:12.000000",
        "description": null,
        "id": "e702d7c1-c437-4f34-88a3-237d942a53fc",
        "links": {
            "self": "http://10.180.64.22:9001/v2/zones/bc49118c-405d-4497-a567-76ba1b3cacd9/recordsets/e702d7c1-c437-4f34-88a3-237d942a53fc"
        },
        "name": "www.example.net.",
        "records": [
            "10.0.0.2",
            "10.0.0.3"
        ],
        "ttl": null,
        "type": "A",
        "updated_at": "2015-01-19T18:19:29.000000",
        "version": 2,
        "zone_id": "bc49118c-405d-4497-a567-76ba1b3cacd9"
    }
}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

Fix proposed to branch: master
Review: https://review.openstack.org/148328

Changed in designate:
assignee: nobody → stanzgy (stanzgy)
status: New → In Progress
Kiall Mac Innes (kiall)
Changed in designate:
importance: Undecided → Critical
milestone: none → kilo-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/148328
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=39322736e2e6938b01d34bf5634d7227e2f780db
Submitter: Jenkins
Branch: master

commit 39322736e2e6938b01d34bf5634d7227e2f780db
Author: stanzgy <email address hidden>
Date: Tue Jan 20 02:29:22 2015 +0800

    Fix v2 api update_recordset

    Fix v2 api update_recordset when updating a recordset's records.

    Change-Id: I91a91b075787dfc6df4e6a590a0e92ecc942ba45
    Closes-Bug: 1412539

Changed in designate:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in designate:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in designate:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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