def role_delete(role_id=None, name=None, profile=None, **connection_args):
 kstone = auth(profile, **connection_args)
 if name:
  for role in kstone.roles.list():
   if (role.name == name):
    role_id = role.id
    break
 if (not role_id):
  return {'Error': 'Unable to resolve role id'}
 role = kstone.roles.get(role_id)
 kstone.roles.delete(role)
 ret = 'Role ID {0} deleted'.format(role_id)
 if name:
  ret += ' ({0})'.format(name)
 return ret

def role_delete ( role_id = None , name = None , profile = None , ** connection_args ) : kstone = auth ( profile , ** connection_args ) if name : for role in kstone . roles . list ( ) : if ( role . name == name ) : role_id = role . id break if ( not role_id ) : return { 'Error' : 'Unable to resolve role id' } role = kstone . roles . get ( role_id ) kstone . roles . delete ( role ) ret = 'Role ID {0} deleted' . format ( role_id ) if name : ret += ' ({0})' . format ( name ) return ret
delete a role cli examples: .