Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

[Tenant] Improve error message thrown while trying to add same vm to another tenant #930

Closed
ashahi1 opened this issue Feb 17, 2017 · 0 comments

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Feb 17, 2017

Steps to repro:

  1. Create a tenant and add vm to it:
    /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant create --name=tenant1 --vm-list=TestVM-1

  2. Create another tenant and try adding same vm to the new tenant:
    /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant create --name=tenant2 --vm-list=TestVM-1

Error message returned: Internal Error(UNIQUE constraint failed: vms.vm_id)

=====
Error message should be such that its easier to understand for the user that adding same vm to two tenants is not allowed.

@ashahi1 ashahi1 added this to the 0.12 milestone Feb 17, 2017
@tusharnt tusharnt modified the milestones: 0.13, 0.12 Feb 23, 2017
@tusharnt tusharnt changed the title [Tenant] Trying to add same vm to another tenant returns error: Internal Error(UNIQUE constraint failed: vms.vm_id) [Tenant] Improve error message thrown while trying to add same vm to another tenant Feb 23, 2017
pshahzeb pushed a commit that referenced this issue Mar 4, 2017
1. Checking if VM is already a part of another tenant in both tenant_create
and tenant_vm_add methods. Appropriate error messages instead of using the database error

Testing:
Updated tenant_vm tests to evalaute this case

Resolves: #930
pshahzeb pushed a commit that referenced this issue Mar 4, 2017
1. Checking if VM is already a part of another tenant in both tenant_create
and tenant_vm_add methods. Appropriate error messages instead of using the database error

Testing:
Updated tenant_vm tests to evalaute this case

Resolves: #930
pshahzeb pushed a commit that referenced this issue Mar 9, 2017
1. Ensuring VM already in a tenant cannot be added to another tenant through tenant_create, tenant_vm_add and tenant_vm_replace methods
2. Ensuring VM list in tenant_vm_add, tenant_vm_replace, tenant_vm_rm cannot be empty and doesn’t contain duplicates
3. Ensuring existing VM in a tenant cannot be replaced back into same tenant
4. Sequenced parameter processing and error message simplification

Resolves: #930, #994
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants