We can create vims with same name in same tenant.

Bug #1697818 reported by Yan Xing'an
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Critical
dharmendra

Bug Description

I create a vim twice with same config-file and same name, find it successed.

yanxa@ubuntu:~/mywork$ tacker vim-register --config-file vim-yanxingan2.yaml vim-yanxa2
yanxa@ubuntu:~/mywork$ tacker vim-register --config-file vim-yanxingan2.yaml vim-yanxa2

yanxa@ubuntu:~/mywork$ tacker vim-list |grep -E '(vim-yanxa2|tenant_id)'
| id | tenant_id | name | type | is_default | placement_attr | status |
| 45fa8c72-a127-48ac-9549-04decf7cd476 | 56c4a3d5240b41ef8e39b5e3b8a85605 | vim-yanxa2 | openstack | False | {u'regions': [u'RegionOne']} | REACHABLE |
| ce62645b-accf-49bc-9859-08c81c98be10 | 56c4a3d5240b41ef8e39b5e3b8a85605 | vim-yanxa2 | openstack | False | {u'regions': [u'RegionOne']} | REACHABLE |

According to the constraint of VIM, we should not have two vim with same names.
     __table_args__ = (
        schema.UniqueConstraint(
            "tenant_id",
            "name",
            "deleted_at",
            name="uniq_vim0tenant_id0name0deleted_at"),
    )

Yan Xing'an (yanxingan)
Changed in tacker:
assignee: nobody → Yan Xing'an (yanxingan)
Changed in tacker:
milestone: none → pike-3
importance: Undecided → Critical
Revision history for this message
dharmendra (dharmendra-kushwaha) wrote :

This issue occurred after [1].
In that patch, We had introduce the unique constraint over name, tenant_id and deleted_at column. Where default value of deleted_at is NULL. The main point is Creating unique constraint over nullable key, actually destroy the property of uniqueness, and this bug occurred.

[1]: https://review.openstack.org/#/c/455421/

Changed in tacker:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

Changed in tacker:
assignee: Yan Xing'an (yanxingan) → dharmendra (dharmendra-kushwaha)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/476449
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=405579b01d16f4d47ead8f353ea2fc88d6f50a67
Submitter: Jenkins
Branch: master

commit 405579b01d16f4d47ead8f353ea2fc88d6f50a67
Author: dharmendra <email address hidden>
Date: Tue Jul 4 00:55:58 2017 +0000

    Prevent to create duplicate entry

    Closes-Bug: #1697818

    Change-Id: Ie35ebb68a611a00632ba2ba860fd6a6cd7ec9dbb

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 0.8.0

This issue was fixed in the openstack/tacker 0.8.0 release.

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.