def connected_start(): global conn_list ip = nm.get_active_ip() mdns.add_hosts(dns_names, ip) conn_list = []
def hotspot_pass(): log.debug("Activating mdns") # IP tolerance for PI 2 for _ in range(5): ip = nm.get_active_ip(modemgr.get_state_device('HOTSPOT')) if ip: mdns.clear_entries() mdns.add_hosts(dns_names) break time.sleep(1)
def connected_start(): global conn_list # IP tolerance for PI 2 for _ in range(5): ip = nm.get_active_ip(modemgr.get_state_device('CONNECTED')) if ip: mdns.clear_entries() mdns.add_hosts(dns_names) break time.sleep(1) conn_list = []
def add_hosts(hosts): establish_group() i = 0 for device in nm.get_devices(): i += 1 name = nm.device_name(device) addr = nm.get_active_ip(device) if (name in nm.get_phys_dev_names()) and addr: for host in hosts: make_a_record(host, i, addr) add_service(hosts[0], i, addr) group.Commit()
def add_hosts(hosts): establish_group() int_mapping = get_interface_mapping() for device in nm.get_devices(): name = nm.device_name(device) addr = nm.get_active_ip(device) if (name in nm.get_phys_dev_names() and name in int_mapping and addr): index = int_mapping[name] for host in hosts: make_a_record(host, index, addr) add_service(hosts[0], index, addr) group.Commit()
def hotspot_pass(): log.debug("Activating mdns") ip = nm.get_active_ip() mdns.add_hosts(dns_names, ip)