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

[Tenant]Error message is not clear while trying to add two vms with same names to a tenant. #994

Closed
ashahi1 opened this issue Mar 4, 2017 · 2 comments
Assignees
Milestone

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Mar 4, 2017

Error message reported when user tries to add two VMs with same names to a tenant with single command - Internal Error(UNIQUE constraint failed: vms.vm_id)

Proper error message be thrown so that it's easier for user to understand.

[root@sc-rdops-vm18-dhcp-47-89:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant vm add --name=tenant1 --vm-list=Ubuntu-VM1-89,Ubuntu-VM1-89
Internal Error(UNIQUE constraint failed: vms.vm_id)

@ashahi1 ashahi1 added this to the v1 GA milestone Mar 4, 2017
@pshahzeb
Copy link
Contributor

pshahzeb commented Mar 7, 2017

Is there a need for error? Should we just remove duplicates from the list of VM names?

// CC @lipingxue @msterin

@msterin
Copy link
Contributor

msterin commented Mar 7, 2017

I think the perfect way would be remove a duplicate a warn.
An acceptable way would be to fail with a clear message.
removing a duplicate silently is not nice , it could be a user typo :-)

@shuklanirdesh82 shuklanirdesh82 modified the milestones: 0.13, v1 GA Mar 7, 2017
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
pshahzeb pushed a commit that referenced this issue Mar 11, 2017
Handling corner cases to add,remove, replace vms in a tenant

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants