nobodd.server
This module contains the server and handler classes which make up the main nobodd-tftpd application, as well as the entry point for the application itself.
Handler classes
- class nobodd.server.BootHandler(request, client_address, server)[source]
A descendent of
TFTPBaseHandlerthat resolves paths relative to the FAT file-system in the OS image associated with the Pi serial number which forms the initial directory.- resolve_path(filename)[source]
Resolves filename relative to the OS image associated with the initial directory.
In other words, if the request is for
1234abcd/config.txt, the handler will look up the board with serial number1234abcdinBootServer.boards, find the associated OS image, the FAT file-system within that image, and resolveconfig.txtwithin that file-system.
Server classes
- class nobodd.server.BootServer(server_address, boards)[source]
A descendent of
TFTPBaseServerthat is configured with boards, a mapping of Pi serial numbers toBoardinstances, and usesBootHandleras the handler class.
Application functions
- nobodd.server.main(args=None)[source]
The main entry point for the nobodd-tftpd application. Takes args, the sequence of command line arguments to parse. Returns the exit code of the application (0 for a normal exit, and non-zero otherwise).
If
DEBUG=1is found in the application’s environment, top-level exceptions will be printed with a full back-trace.DEBUG=2will launch PDB in post-mortem mode.
- nobodd.server.request_loop(server_address, boards)[source]
The application’s request loop. Takes the server_address to bind to, which may be a
(address, port)tuple, or anintfile-descriptor passed by a service manager, and the boards configuration, adictmapping serial numbers toBoardinstances.Raises
ReloadRequestorTerminateRequestin response to certain signals, but is an infinite loop otherwise.
- nobodd.server.get_parser()[source]
Returns the command line parser for the application, pre-configured with defaults from the application’s configuration file(s). See
ConfigArgumentParser()for more information.
Exceptions
- exception nobodd.server.ReloadRequest[source]
Exception class raised in
request_loop()to cause a reload. Handled inmain().
- exception nobodd.server.TerminateRequest(returncode, message='')[source]
Exception class raised in
request_loop()to cause service termination. Handled inmain(). Takes the return code of the application as the first argument.