def validate_ap_interface(interface): """ Validate the given interface :param interface: Name of an interface :type interface: str :return: None :rtype: None :raises: argparse.ArgumentTypeError in case of invalid interface """ if not(pyric.pyw.iswireless(interface) and \ pyric.pyw.isinterface(interface) and \ interfaces.does_have_mode(interface, "AP")): raise argparse.ArgumentTypeError("Provided interface ({}) \ either does not exist or " " does not support AP mode" \ .format(interface))
def validate_ap_interface(interface): """ Validate the given interface :param interface: Name of an interface :type interface: str :return: the ap interface :rtype: str :raises: argparse.ArgumentTypeError in case of invalid interface """ if not(pyric.pyw.iswireless(interface) and \ pyric.pyw.isinterface(interface) and \ interfaces.does_have_mode(interface, "AP")): raise argparse.ArgumentTypeError("Provided interface ({}) \ either does not exist or " " does not support AP mode" \ .format(interface)) return interface