Glare patch api move operation doesn't work as expected

Bug #1743971 reported by Sruthy S
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glare
Fix Released
Medium
Kushal Agrawal

Bug Description

1. Given a NS package in created state:
    "ns_packages": [
        {
            "status": "drafted",
            "description": "NS pkg update",
            "name": "nspkg_update_props_311115258",
            "tags": [
                "tag1",
                "tag2"
            ],
            "created_at": "2018-01-18T06:30:56Z",
            "activated_at": null,
            "updated_at": "2018-01-18T06:30:57Z",
            "visibility": "private",
            "package": null,
            "version": "1.0.1",
            "owner": "CloudBandNetworkDirector",
            "id": "db1f00f1-17e4-4dda-9992-8b74b87d01a2",
            "contents": {},
            "metadata": {
                "meta": "meta1"
            }
        }
    ]

2. I send a PATCH request below:
[{
 "operation": "move",
 "srcAttr": "tags/0",
 "targetAttr": "metadata/meta2"
}]

Response:
        {
            "status": "drafted",
            "description": "NS pkg update",
            "name": "nspkg_update_props_311115258",
            "tags": [
                "tag1",
                "tag2"
            ],
            "created_at": "2018-01-18T06:30:56Z",
            "activated_at": null,
            "updated_at": "2018-01-18T06:50:11Z",
            "visibility": "private",
            "package": null,
            "version": "1.0.1",
            "owner": "CloudBandNetworkDirector",
            "id": "db1f00f1-17e4-4dda-9992-8b74b87d01a2",
            "contents": {},
            "metadata": {
                "meta2": "tag1",
                "meta": "meta1"
            }
        }

It's observed that tag1 is copied and not moved as mentioned in http://jsonpatch.com/. We already have a copy operation which copies data from one attribute to other.

Sruthy S (sruts)
description: updated
Mike Fedosin (mfedosin)
Changed in glare:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glare (master)

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

Changed in glare:
assignee: nobody → Kushal Agrawal (kushal2605)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glare (master)

Reviewed: https://review.openstack.org/561544
Committed: https://git.openstack.org/cgit/openstack/glare/commit/?id=57a589fccdfa6ab3cec69dd44b35ee8917b63bd7
Submitter: Zuul
Branch: master

commit 57a589fccdfa6ab3cec69dd44b35ee8917b63bd7
Author: Kushal Agrawal <email address hidden>
Date: Mon Apr 16 13:51:28 2018 +0530

    Move Operation bug fix in update API

    updating the value of source location in move operation
    as part of artifact update.

    Change-Id: Ic6912fa9c714762e38ba01793a7a8da1a70a12ba
    Closes-bug: #1743971

Changed in glare:
status: In Progress → Fix Released
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.