def config_fallocate_value(reserve_value):
 try:
  if (str(reserve_value[(-1):]) == '%'):
   reserve_value = float(reserve_value[:(-1)])
   is_percent = True
  else:
   reserve_value = int(reserve_value)
   is_percent = False
 except ValueError:
  raise ValueError(('Error: %s is an invalid value for fallocate_reserve.' % reserve_value))
 return (reserve_value, is_percent)

def config_fallocate_value ( reserve_value ) : try : if ( str ( reserve_value [ ( - 1 ) : ] ) == '%' ) : reserve_value = float ( reserve_value [ : ( - 1 ) ] ) is_percent = True else : reserve_value = int ( reserve_value ) is_percent = False except ValueError : raise ValueError ( ( 'Error: %s is an invalid value for fallocate_reserve.' % reserve_value ) ) return ( reserve_value , is_percent )
returns fallocate reserve_value as an int or float .