Skip to main content

Add your description here

Project description

TFTP driver

jumpstarter-driver-tftp provides functionality for a read-only TFTP server that can be used to serve files.

Installation

:substitutions:
$ pip3 install --extra-index-url {{index_url}} jumpstarter-driver-tftp

Configuration

Example configuration:

export:
  tftp:
    type: jumpstarter_driver_tftp.driver.Tftp
    config:
      root_dir: /var/lib/tftpboot  # Directory to serve files from
      host: 192.168.1.100          # Host IP to bind to (optional)
      port: 69                     # Port to listen on (optional)

Config parameters

Parameter Description Type Required Default
root_dir Root directory for the TFTP server str no "/var/lib/tftpboot"
host IP address to bind the server to str no auto-detect
port Port number to listen on int no 69

API Reference

.. autoclass:: jumpstarter_driver_tftp.client.TftpServerClient()
   :members:
   :show-inheritance:

Exception Classes

.. autoclass:: jumpstarter_driver_tftp.driver.TftpError
   :members:
   :show-inheritance:

.. autoclass:: jumpstarter_driver_tftp.driver.ServerNotRunning
   :members:
   :show-inheritance:

Examples

>>> import tempfile
>>> import os
>>> from jumpstarter_driver_tftp.driver import Tftp
>>> from jumpstarter.common.utils import serve
>>> with tempfile.TemporaryDirectory() as tmp_dir:
...     # Create a test file
...     test_file = os.path.join(tmp_dir, "test.txt")
...     with open(test_file, "w") as f:
...         _ = f.write("hello")
...
...     # Start TFTP server
...     with serve(Tftp(root_dir=tmp_dir, host="127.0.0.1", port=6969)) as tftp:
...         tftp.start()
...
...         # List files
...         files = list(tftp.storage.list("/"))
...         assert "test.txt" in files
...
...         tftp.stop()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jumpstarter_driver_tftp-0.7.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jumpstarter_driver_tftp-0.7.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file jumpstarter_driver_tftp-0.7.0.tar.gz.

File metadata

File hashes

Hashes for jumpstarter_driver_tftp-0.7.0.tar.gz
Algorithm Hash digest
SHA256 b2692691b704a9d4526c4edafc93b279c0795b303b3a94467ff5de84f3a639ac
MD5 3d4854447705d3e14105ddca973ba994
BLAKE2b-256 9fb56dbdd03328325e06552d5fd0de5f7d0102e434af3120056761877412653a

See more details on using hashes here.

File details

Details for the file jumpstarter_driver_tftp-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jumpstarter_driver_tftp-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2af979d615335b3aa729ab778d6bc9deb332ec7972a9267879bd2cbcc8718b6c
MD5 f66460c8653f60697f1a2c21e4d8494b
BLAKE2b-256 34d1e8d8900e52e9da0ce9532dfec46691281d8561ce0f0570c262ce1cda86ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page