file_handle = kwargs.get("file_handle") logger.debug( f"Unlocking the file {file_name} on host {host}, owner={owner}, client={client_name}," f" kwargs = {kwargs}") file_handle = self._get_file_handle( host, export, file_name) if not file_handle else file_handle nlm_client = NLMClient(host) unlock_arguments = get_packer_arguments("UNLOCK", caller_name=client_name, owner=owner, fh=file_handle, l_offset=offset, l_len=length) status = nlm_client.unlock(unlock_arguments) return NLM4_Stats(status).name def _get_file_handle(self, host, export, file_name): file_handle = self.exposed_lookup_file(host, export, file_name) if not file_handle: raise FileNotFound( f"{file_name} cannot be found and file_handle was not specified" ) return file_handle if __name__ == "__main__": FileHandler("nfs_client.log").push_application() t = ThreadedServer(NFSClientWrapper, port=9999) t.daemon = True logger.notice("Starting server on port 9999") t.start()