Add validation for the parameter provider_id in checkpoint POST API

Bug #1657636 reported by chenying
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Karbor
Fix Released
Undecided
chenying

Bug Description

Add validation for the parameter provider_id in checkpoint POST API.
When the user call the create checkpoint API, the user need provide a parameter provider_id, but the provider_id in checkpoint is not checked with the value in plan.

Now the parameter provider_id of checkpoint is not same as the value in plan, but the
checkpoint also can be created.

root@SZX1000173489:~# karbor provider-list
+--------------------------------------+-------------------+------------------------------------------------------------------------+
| Id | Name | Description |
+--------------------------------------+-------------------+------------------------------------------------------------------------+
| cf56bd3e-97a7-4078-b6d5-f36246333fd9 | OS Infra Provider | This provider uses OpenStack's own services (swift, cinder) as storage |
+--------------------------------------+-------------------+------------------------------------------------------------------------+
root@SZX1000173489:~# karbor provider-list
+--------------------------------------+-------------------+------------------------------------------------------------------------+
| Id | Name | Description |
+--------------------------------------+-------------------+------------------------------------------------------------------------+
| b766f37c-d011-4026-8228-28730d734a3f | Noop | This provider uses a Noop Protection Plugin for every resource |
| cf56bd3e-97a7-4078-b6d5-f36246333fd9 | OS Infra Provider | This provider uses OpenStack's own services (swift, cinder) as storage |
+--------------------------------------+-------------------+------------------------------------------------------------------------+
root@SZX1000173489:~# karbor plan-show a2cb79c6-dfde-45cc-8e6c-aecae5c87203
+-------------+------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-------------+------------------------------------------------------------------------------------------------------------------------+
| description | None |
| id | a2cb79c6-dfde-45cc-8e6c-aecae5c87203 |
| name | OS Images protection plan. |
| parameters | {} |
| provider_id | cf56bd3e-97a7-4078-b6d5-f36246333fd9 |
| resources | [{u'type': u'OS::Glance::Image', u'id': u'e9e2888b-ec43-4209-ae9e-98cd79b01d62', u'name': u'cirros-0.3.4-x86_64-uec'}] |
| status | suspended |
+-------------+------------------------------------------------------------------------------------------------------------------------+
root@SZX1000173489:~#
root@SZX1000173489:~# karbor checkpoint-create b766f37c-d011-4026-8228-28730d734a3f a2cb79c6-dfde-45cc-8e6c-aecae5c87203
+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | None |
| id | 8186ba26-c73e-4b1f-a7ce-26f1c7f1f724 |
| project_id | d8b88615407146d190f7fca3e9bc19a4 |
| protection_plan | {u'id': u'a2cb79c6-dfde-45cc-8e6c-aecae5c87203', u'resources': [{u'type': u'OS::Glance::Image', u'id': u'e9e2888b-ec43-4209-ae9e-98cd79b01d62', u'name': u'cirros-0.3.4-x86_64-uec'}], u'name': u'OS Images protection plan.'} |
| resource_graph | None |
| status | protecting |
+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
root@SZX1000173489:~#

chenying (ying-chen)
description: updated
chenying (ying-chen)
Changed in karbor:
assignee: nobody → chenying (ying-chen)
chenying (ying-chen)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to karbor (master)

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

Changed in karbor:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on karbor (master)

Change abandoned by chenying (<email address hidden>) on branch: master
Review: https://review.openstack.org/423108
Reason: The same as this one. https://review.openstack.org/#/c/422626/

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

Reviewed: https://review.openstack.org/423108
Committed: https://git.openstack.org/cgit/openstack/karbor/commit/?id=e12313b5b825d73002c1734bb18a741605d806d8
Submitter: Jenkins
Branch: master

commit e12313b5b825d73002c1734bb18a741605d806d8
Author: chenying <email address hidden>
Date: Thu Jan 19 21:34:50 2017 +0800

    Add validation for the parameter provider_id in checkpoint POST API

    1) When the user call the create checkpoint API, the user need provide
    a parameter provider_id, but the provider_id in checkpoint is not
    checked with the value in plan.

    Now the parameter provider_id of checkpoint is not same as the value
    in plan, but the checkpoint also can be created.

    2)The property `management_url` of novaclient is deprecated for
    SessionClient. Use `endpoint_override` instead.

    Change-Id: I2642af71e875500e125a85c9d32b2828f194b775
    Closes-Bug: #1657636

Changed in karbor:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on karbor (master)

Change abandoned by chenying (<email address hidden>) on branch: master
Review: https://review.openstack.org/422626
Reason: It is the same as this one. https://review.openstack.org/#/c/423108/

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.