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.1.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.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_tftp-0.7.1.tar.gz
Algorithm Hash digest
SHA256 e194cd427caebb68d62bd61b4b1b819c9ba315fcd44d1d70df81d9a2ceb2eeb6
MD5 85fa02a8887dde160c97a906a23c576b
BLAKE2b-256 64333cd19c168112b1d3ff6e72197f26c6fa261f1438c166e16b89116fcb0c07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jumpstarter_driver_tftp-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaed245386a0f872083ee4aab126e07708e490da4ba8020afefd0e8b02459259
MD5 66540dc6c578f1b06d62c6a8348a9255
BLAKE2b-256 c55838adccf4fb2daf4deffcba67e2178569707fb896131af992776500200fdc

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