def rewrite_user(user):
 if (user is None):
  LOG.warn('Failed to rewrite user, user is None.')
 else:
  augment = get_user_augmentation_class()(user)
  for attr in ('get_groups', 'get_home_directory', 'has_hue_permission'):
   setattr(user, attr, getattr(augment, attr))
 return user

def rewrite_user ( user ) : if ( user is None ) : LOG . warn ( 'Failed to rewrite user, user is None.' ) else : augment = get_user_augmentation_class ( ) ( user ) for attr in ( 'get_groups' , 'get_home_directory' , 'has_hue_permission' ) : setattr ( user , attr , getattr ( augment , attr ) ) return user
rewrites the user according to the augmentation class .