def _api_version(profile=None, **connection_args):
    '''
    Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID
    depending on API version.
    '''
    global _TENANT_ID
    global _OS_IDENTITY_API_VERSION
    try:
        if float(__salt__['keystone.api_version'](profile=profile, **connection_args).strip('v')) >= 3:
            _TENANT_ID = 'project_id'
            _OS_IDENTITY_API_VERSION = 3
    except KeyError:
        pass
Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID
    depending on API version.