def get_existing_configuration_uuid() -> Optional[str]: uuid = get_uuid() if uuid is None: return None client = get_client() connection = client.get_connection_by_uuid(uuid) if connection is None: return None else: return uuid
def save_connection(client: 'NM.Client', config, private_key, certificate, callback=None): _logger.info("writing configuration to Network Manager") new_con = import_ovpn(config, private_key, certificate) uuid = get_uuid() if uuid: old_con = client.get_connection_by_uuid(uuid) if old_con: update_connection(old_con, new_con, callback) return add_connection(client=client, connection=new_con, callback=callback)
def deactivate(): """ Deactivates an existing configuration """ deactivate_connection_with_mainloop(get_uuid())
def activate(): """ Activates an existing configuration """ refresh() activate_connection_with_mainloop(get_uuid())
def test_activate_connection(self): get_client() get_uuid()
def test_get_uuid(self): get_uuid()
def test_activate_connection(self): client = get_client() uuid = get_uuid()
def test_get_uuid(self): uuid = get_uuid()