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

need proper validation while adding a datastore access for a tenant (admin_cli is allowing to add nonexistent datastore) #827

Closed
shuklanirdesh82 opened this issue Dec 16, 2016 · 1 comment

Comments

@shuklanirdesh82
Copy link
Contributor

Steps to repro:

  1. create tenant let's say T1
    vmdkops_admin.py tenant create --name=T1

  2. create access list for Tenant T1 with nonexistent datastore (e.g. randomDS)
    vmdkops_admin.py tenant access add --name=T1 --datastore=randomDS

  3. List all access info for a tenant T1
    vmdkops_admin.py tenant access ls --name=T1

Expectation: access rule should not be created for '--datastore=randomDS'

Here is what admin_cli is returning:

vmdkops_admin.py tenant access ls --name=T1
Datastore          Create_volume  Delete_volume  Mount_volume  Max_volume_size  Total_size  
-----------------  -------------  -------------  ------------  ---------------  ----------       
randomDS           False          False          False         Unset            Unset  
@lipingxue lipingxue self-assigned this Feb 1, 2017
@pdhamdhere pdhamdhere added this to the v1 GA milestone Feb 1, 2017
@pdhamdhere pdhamdhere modified the milestones: 0.12, v1 GA Feb 9, 2017
@lipingxue lipingxue assigned pshahzeb and unassigned lipingxue Feb 15, 2017
@pshahzeb
Copy link
Contributor

This is fixed. See the output below in case of non existing datastore.

[root@sc-rdops-vm04-dhcp-106-149:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant create --name=T1
tenant create succeeded
[root@sc-rdops-vm04-dhcp-106-149:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access add --name=T1 --datastore=randomDS
Datastore randomDS does not exist

Relevant calls to check datastore existence in both tenant_access_add and tenant_access_set
as follows:

    error_info = check_datastore(datastore)
    if error_info:
        return error_info

This was fixed in #859

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants