code: def get_subnet_length(mask):
      '''
      Convenience function to convert the netmask to the CIDR subnet length
  
      CLI Example:
  
      .. code-block:: bash
  
          salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0
      '''
      if not salt.utils.validate.net.netmask(mask):
          raise SaltInvocationError(
              '\'{0}\' is not a valid netmask'.format(mask)
          )
      return salt.utils.network.get_net_size(maskf get_subnet_length(mask):
      '''
      Convenience function to convert the netmask to the CIDR subnet length
  
      CLI Example:
  
      .. code-block:: bash
  
          salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0
      '''
      if not salt.utils.validate.net.netmask(mask):
          raise SaltInvocationError(
              '\'{0}\' is not a valid netmask'.format(mask)
          )
      return salt.utils.network.get_net_size(mask)
docs: Convenience function to convert the netmask to the CIDR subnet length
  
      CLI Example:
  
      .. code-block:: bash
  
          salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0