[openstack-dev] [qa] Question about is_admin_available()

David Kranz dkranz at redhat.com
Tue Mar 10 21:38:40 UTC 2015


In the process of writing a unit test for this I discovered that it can 
call out to keystone for a token with some configurations through the 
call to get_configured_credentials. This surprised me since I thought it 
would just check for the necessary admin credentials in either 
tempest.conf or accounts.yaml. Is this a bug?

  -David


def is_admin_available():
     is_admin = True
     # If tenant isolation is enabled admin will be available
     if CONF.auth.allow_tenant_isolation:
         return is_admin
     # Check whether test accounts file has the admin specified or not
     elif os.path.isfile(CONF.auth.test_accounts_file):
         check_accounts = accounts.Accounts(name='check_admin')
         if not check_accounts.admin_available():
             is_admin = False
     else:
         try:
cred_provider.get_configured_credentials('identity_admin')
         except exceptions.InvalidConfiguration:
             is_admin = False
     return is_admin




More information about the OpenStack-dev mailing list