def connect(self, ssid, password): if nm.get_connection_by_ssid(ssid): nm.del_connection_by_ssid(ssid) nm.make_connection_for(ssid, password) states.set_state('CONNECTING', [ssid, ssid])
def to_fn(ssid, password): if nm.get_connection_by_ssid(ssid): nm.del_connection_by_ssid(ssid) nm.make_connection_for(ssid, password) states.set_state('CONNECTING', [ssid, ssid]) return False
def to_fn(ssid, password): if nm.get_connection_by_ssid(ssid): nm.del_connection_by_ssid(ssid) nm.make_connection_for( ssid, password, link_local=conf.getboolean("ipv6_link_local") ) states.set_state("CONNECTING", [ssid, ssid]) return False
def connecting_fail(reason: int) -> None: global conn_list log.debug("Connection failed - reason {}".format(reason)) badreasons = [ NetworkManager.NM_DEVICE_STATE_REASON_NO_SECRETS, ] if reason in badreasons: log.error("Connection {} config failure - DELETING".format(connection)) nm.del_connection_by_ssid(connection) if conn_list: set_state("CONNECTING", force=True) else: set_state("HOTSPOT")
def test_del_connection_by_ssid(connections_fxt): nm.del_connection_by_ssid("myssid") assert connections_fxt.Delete.called
def to_fn(): ssid = nm.get_active_ssid(modemgr.get_link_device()) nm.del_connection_by_ssid(ssid) states.set_state('HOTSPOT') return False
def assure_hotspot(ssid: str, device: NetworkManager.Device, password: str) -> None: nm.del_connection_by_ssid(ssid) if not nm.get_connection_by_ssid(ssid): nm.make_hotspot(ssid, device, password)
def assure_hotspot(ssid, device, password): log.debug("states: Calling nm.get_connection_by_ssid()") nm.del_connection_by_ssid(ssid) if not nm.get_connection_by_ssid(ssid): nm.make_hotspot(ssid, device, password)
def nuke(): for ssid in nm.get_all_wifi_connection_ssids(): nm.del_connection_by_ssid(ssid) os.kill(os.getpid(), signal.SIGTERM)
def delete_connection(self): ssid = nm.get_active_ssid(modemgr.get_link_device()) nm.del_connection_by_ssid(ssid) states.set_state('HOTSPOT')