def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args):
 kstone = auth(profile, **connection_args)
 if name:
  for tenant in getattr(kstone, _TENANTS, None).list():
   if (tenant.name == name):
    tenant_id = tenant.id
    break
 if (not tenant_id):
  return {'Error': 'Unable to resolve tenant id'}
 getattr(kstone, _TENANTS, None).delete(tenant_id)
 ret = 'Tenant ID {0} deleted'.format(tenant_id)
 if name:
  ret += ' ({0})'.format(name)
 return ret

def tenant_delete ( tenant_id = None , name = None , profile = None , ** connection_args ) : kstone = auth ( profile , ** connection_args ) if name : for tenant in getattr ( kstone , _TENANTS , None ) . list ( ) : if ( tenant . name == name ) : tenant_id = tenant . id break if ( not tenant_id ) : return { 'Error' : 'Unable to resolve tenant id' } getattr ( kstone , _TENANTS , None ) . delete ( tenant_id ) ret = 'Tenant ID {0} deleted' . format ( tenant_id ) if name : ret += ' ({0})' . format ( name ) return ret
delete a tenant cli examples: .