Comment 1 for bug 1522713

Revision history for this message
Raga lahari (raga-lahari) wrote :

Hi,

To validate tenant name in novaclient for the command "nova quota-show --tenant <name>",Need to get the tenant list from keystoneclient. We are planning to implement following solution to get tenant list

from keystoneclient import session
from keystoneclient.v2_0 import client as kclient

def _tenant_list(cs):
   sess = session.Session(cs.client.auth)
   kc = kclient.Client(session=sess)
   tenant_list = kc.tenants.list()
   tenants = dict((x.id, x.name) for x in tenant_list)

Please let me know your comments.