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

Not able to see access rights for default vmgroup without running 'config init' #1396

Closed
ashahi1 opened this issue Jun 12, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Jun 12, 2017

Steps:

  1. There is only _DEFAULT vmgroup
  2. Tried to see access rights for _DEFAULT vmgroup - Failed with error : Please init configuration with 'vmdkops_admin.py config init' before changing it.

Ideally, user shouldn't have to do config init if the user just wants to see access rights for _DEFAULT tenant.


Steps and their output are as follows:

  1. There is only _DEFAULT vmgroup
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup ls
Uuid                                  Name      Description                Default_datastore  VM_list
------------------------------------  --------  -------------------------  -----------------  -------
11111111-1111-1111-1111-111111111111  _DEFAULT  This is a default vmgroup  _VM_DS

  1. Tried to see access rights for _DEFAULT vmgroup - Failed
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup access ls --name=_DEFAULT
Please init configuration with 'vmdkops_admin.py config init' before changing it.
[root@sc-rdops-vm04-dhcp-100-33:~]

===============

Logs:
vmdk_ops.txt

@ashahi1 ashahi1 added this to the 0.16 milestone Jun 12, 2017
@ashahi1 ashahi1 changed the title Not able to see access rights for _DEFAULT vmgroup without running 'config init' Not able to see access rights for default vmgroup without running 'config init' Jun 12, 2017
@govint govint self-assigned this Jun 13, 2017
@govint
Copy link
Contributor

govint commented Jun 14, 2017

Given the state of the code I'd suggest that the default vmgroup handling is non-trivial.

  1. Functions that retrieve the access attrs for tenants in auth_api.py(_tenant_access_ls) require that the DB is initialized else they aren't ever called. So, even for the default vmgroup the DB is needed.
  2. Suppose we allow the function to be called (_tenant_access_ls()), the called functions to get tenant privileges pass back a dict which the admin CLI code is unable to use. Admin CLI code expects an object and hence fails with the dict returned from auth_data.py:get_tenant().

I tried out changing these but the changes are unnecessary and involves changing a set of functions that are otherwise working fine at this point. Its easier to instead init the DB and the command is working fine at present to instruct the user to initialize the DB first.

Posting a PR to improve the error message.

@msterin
Copy link
Contributor

msterin commented Jun 14, 2017

It feels.like we still disagree on user experience and what's needed there and what's nit. Let's agree on it first, offline, and then make decisions about cleaning up the implementation , or leaving it as is with error messages.

@govint
Copy link
Contributor

govint commented Jun 16, 2017

Closing this, based on what we decide for #1397 open a new issue to address all changes to enable updates to default vmgroup attrs.

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

No branches or pull requests

3 participants