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

Running into "IndexError: list index out of range" exception while listing out all access info for a tenant "_DEFAULT" #867

Closed
shuklanirdesh82 opened this issue Jan 20, 2017 · 3 comments
Assignees
Milestone

Comments

@shuklanirdesh82
Copy link
Contributor

Steps to reproduce:

  1. make sure vmdkops_admin is running file
  2. invoke following command and expect correct output
    vmdkops_admin.py tenant access ls --name _DEFAULT
  3. verifies that access information comes back successfully for the tenant

Seeing following exception while invoking the command

[root@promc-2n-dhcp105-97:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant access ls --name _DEFAULT
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 968, in <module>
    main()
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 46, in main
    args.func(args)
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 964, in tenant_access_ls
    rows = generate_tenant_access_ls_rows(privileges)
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 946, in generate_tenant_access_ls_rows
    datastore = vmdk_utils.get_datastore_name(datastore_url)
  File "/usr/lib/vmware/vmdkops/Python/vmdk_utils.py", line 321, in get_datastore_name
    return res[0]
IndexError: list index out of range

/CC @kerneltime @tusharnt @ashahi1

@shuklanirdesh82
Copy link
Contributor Author

our VmdkTenantTestCase does fail with this issue

[root@sc-rdops-vm02-dhcp-37-215:/tmp/vmdk_ops_unittest15996] python vmdk_ops_test.py 
...........This operation may take a while. Please be patient.
This operation may take a while. Please be patient.
..E...
======================================================================
ERROR: test_vmdkops_on_default_tenant_vm (__main__.VmdkTenantTestCase)
Test vmdk life cycle on a VM which belongs to DEFAULT tenant
----------------------------------------------------------------------
Traceback (most recent call last):
  File "vmdk_ops_test.py", line 869, in test_vmdkops_on_default_tenant_vm
    error_info = auth_api._tenant_access_rm(auth.DEFAULT_TENANT, auth.DEFAULT_DS)
  File "/usr/lib/vmware/vmdkops/Python/auth_api.py", line 462, in _tenant_access_rm
    error_info, default_datastore = get_default_datastore(name)
  File "/usr/lib/vmware/vmdkops/Python/auth_api.py", line 214, in get_default_datastore
    error_info, default_datastore = tenant.get_default_datastore(auth_mgr.conn)
  File "/usr/lib/vmware/vmdkops/Python/auth_data.py", line 218, in get_default_datastore
    datastore = vmdk_utils.get_datastore_name(datastore_url)
  File "/usr/lib/vmware/vmdkops/Python/vmdk_utils.py", line 321, in get_datastore_name
    return res[0]
IndexError: list index out of range

----------------------------------------------------------------------
Ran 17 tests in 281.495s

FAILED (errors=1)

@lipingxue lipingxue self-assigned this Feb 1, 2017
@pdhamdhere pdhamdhere added this to the v1 GA milestone Feb 1, 2017
@lipingxue
Copy link
Contributor

Verified this issue has been fixed in top of the master branch, close this issue.

@shuklanirdesh82
Copy link
Contributor Author

Thanks @lipingxue for the verification!

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

No branches or pull requests

3 participants