there is some opportunity for code cleanup and improvement in dealing with update of instance names

Bug #1364701 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Low
Dan Ritchie

Bug Description

We should consider some improvements in the code between the edit() and the update() methods, as well as some cleanup related to the tests.

This bug is being entered to track that. I'm marking it as juno rc.

Riddhi (ridhi-j-shah)
Changed in trove:
assignee: nobody → Riddhi (ridhi-j-shah)
Revision history for this message
Nikhil Manchanda (slicknik) wrote :

Can we add some more details as to what we'd like to clean up here?

Changed in trove:
importance: Undecided → Low
Changed in trove:
status: New → Triaged
Changed in trove:
milestone: juno-rc1 → kilo-1
Revision history for this message
Nikhil Manchanda (slicknik) wrote :

Any updates on this? Thanks!

Changed in trove:
milestone: kilo-1 → kilo-2
Changed in trove:
milestone: kilo-2 → kilo-3
assignee: Riddhi (ridhi-j-shah) → Nikhil Manchanda (slicknik)
Changed in trove:
assignee: Nikhil Manchanda (slicknik) → Dan Ritchie (dan-ritchie)
Revision history for this message
Dan Ritchie (dan-ritchie) wrote :

There are several opportunities for cleanup:

1) The update() and edit() methods implement much of the same functionality with respect to 'configuration', and this duplicate code can be refactored.

2) The update() method should be deprecated in favor of edit() when we version the API. We do not correctly support HTTP PUT, as there are many properties on the instance that we should not support updating via PUT.

3) The edit() method should be modified with respect to 'slave_of' when we version the API.
    - 'slave_of' is currently supported as a flag causing removal the specified instance as a replica of its current master.
    - There is no 'slave_of' property on the instance we are PATCHing (there is 'replica_of', however)
    - If we continue to treat 'slave_of' as an action specifier, we should name it something more appropriate like 'detach_from_master'
    - if we want to treat 'slave_of' like a property of instance during PATCH, we should use 'replica_of', and we should actually update the property to the value we specify. Currently, if some one specifies a valid instance for the value of 'slave_of', we will still just detach the instance from whatever master it is attached to, we will not reflect the specified instance on the specified property. Ie, in the current implementation, the PATCH will not result in the specified property having the specified value.

My current change, https://review.openstack.org/160591, addresses only #1, as we are not yet ready to version APIs.

Changed in trove:
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: kilo-3 → 2015.1.0
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.