How to use the tftpy.TftpShared.TftpException function in tftpy

To help you get started, we’ve selected a few tftpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dhtech / swboot / tftpy / TftpShared.py View on Github external
def tftpassert(condition, msg):
    """This function is a simple utility that will check the condition
    passed for a false state. If it finds one, it throws a TftpException
    with the message passed. This just makes the code throughout cleaner
    by refactoring."""
    if not condition:
        raise TftpException(msg)
github msoulier / tftpy / tftpy / TftpShared.py View on Github external
UnknownTID = 5
    FileAlreadyExists = 6
    NoSuchUser = 7
    FailedNegotiation = 8

class TftpException(Exception):
    """This class is the parent class of all exceptions regarding the handling
    of the TFTP protocol."""
    pass

class TftpTimeout(TftpException):
    """This class represents a timeout error waiting for a response from the
    other end."""
    pass

class TftpFileNotFoundError(TftpException):
    """This class represents an error condition where we received a file
    not found error."""
    pass
github msoulier / tftpy / tftpy / TftpShared.py View on Github external
NotDefined = 0
    FileNotFound = 1
    AccessViolation = 2
    DiskFull = 3
    IllegalTftpOp = 4
    UnknownTID = 5
    FileAlreadyExists = 6
    NoSuchUser = 7
    FailedNegotiation = 8

class TftpException(Exception):
    """This class is the parent class of all exceptions regarding the handling
    of the TFTP protocol."""
    pass

class TftpTimeout(TftpException):
    """This class represents a timeout error waiting for a response from the
    other end."""
    pass

class TftpFileNotFoundError(TftpException):
    """This class represents an error condition where we received a file
    not found error."""
    pass
github dhtech / swboot / tftpy / TftpShared.py View on Github external
UnknownTID = 5
    FileAlreadyExists = 6
    NoSuchUser = 7
    FailedNegotiation = 8

class TftpException(Exception):
    """This class is the parent class of all exceptions regarding the handling
    of the TFTP protocol."""
    pass

class TftpTimeout(TftpException):
    """This class represents a timeout error waiting for a response from the
    other end."""
    pass

class TftpFileNotFoundError(TftpException):
    """This class represents an error condition where we received a file
    not found error."""
    pass
github PackeTsar / freeztp / ztp.py View on Github external
def start_tftp():
	global tftpy
	import tftpy
	try:
		tftpy.TftpContextServer.start = start  # Overwrite the function
		tftpy.TftpContextServer.end = end  # Overwrite the function
		tftpy.TftpStateExpectACK.sendDAT = sendDAT
	except NameError:
		pass
	log("start_tftp: Starting Up TFTPy")
	#tftpy.setLogLevel(logging.DEBUG)
	try:
		server = tftpy.TftpServer(config.running["tftproot"], dyn_file_func=interceptor)
	except tftpy.TftpShared.TftpException:
		log("start_tftp: ERROR: TFTP Root path doesn't exist. Creating...")
		os.system('mkdir -p ' + config.running["tftproot"])
		server = tftpy.TftpServer(config.running["tftproot"], dyn_file_func=interceptor)
	server.listen(listenip="", listenport=69)
	log("start_tftp: Started up successfully")
github msoulier / tftpy / tftpy / TftpShared.py View on Github external
def tftpassert(condition, msg):
    """This function is a simple utility that will check the condition
    passed for a false state. If it finds one, it throws a TftpException
    with the message passed. This just makes the code throughout cleaner
    by refactoring."""
    if not condition:
        raise TftpException(msg)
github dhtech / swboot / tftpy / TftpShared.py View on Github external
NotDefined = 0
    FileNotFound = 1
    AccessViolation = 2
    DiskFull = 3
    IllegalTftpOp = 4
    UnknownTID = 5
    FileAlreadyExists = 6
    NoSuchUser = 7
    FailedNegotiation = 8

class TftpException(Exception):
    """This class is the parent class of all exceptions regarding the handling
    of the TFTP protocol."""
    pass

class TftpTimeout(TftpException):
    """This class represents a timeout error waiting for a response from the
    other end."""
    pass

class TftpFileNotFoundError(TftpException):
    """This class represents an error condition where we received a file
    not found error."""
    pass