-
-
Notifications
You must be signed in to change notification settings - Fork 73
Kathara.foundation.model.LabFilesystemMixin
tcaiazzi edited this page Jul 29, 2025
·
1 revision
Abstraction to manage filesystems of network scenarios.
Attributes:
-
fs(FS): An object referencing a filesystem. Can be both real OS or a memory fs.
__init__()create_startup_file_from_list(
machine: 'MachinePackage.Machine',
commands: List[str]
) → NoneCreate the startup file for the specified device from a list of strings.
Args:
-
machine(Kathara.model.Machine.Machine): The device to create the startup file for. -
commands(str): The startup commands for the device.
Returns: None
Raises:
-
InvocationError: If the fs is None.
create_startup_file_from_path(
machine: 'MachinePackage.Machine',
src_path: str
) → NoneCreate the startup file for the specified device from an existing file on the host filesystem.
Args:
-
machine(Kathara.model.Machine.Machine): The device to create the startup file for. -
src_path(str): The path of the file on the host filesystem to copy.
Returns: None
Raises:
-
InvocationError: If the fs is None.
create_startup_file_from_stream(
machine: 'MachinePackage.Machine',
stream: typing.BinaryIO | typing.TextIO
) → NoneCreate the startup file for a device from a stream.
Args:
-
machine(Kathara.model.Machine.Machine): The device to create the startup file for. -
stream(Union[BinaryIO, TextIO]): The stream representing the content of the file to create.
Returns: None
Raises:
-
InvocationError: If the fs is None. -
UnsupportedOperation: If the stream is opened without read permissions.
create_startup_file_from_string(
machine: 'MachinePackage.Machine',
commands_string: str
) → NoneCreate the startup file for the specified device from a string.
Args:
-
machine(Kathara.model.Machine.Machine): The device to create the startup file for. -
commands_string(str): The startup commands for the device.
Returns: None
Raises:
-
InvocationError: If the fs is None.
update_startup_file_from_list(
machine: 'MachinePackage.Machine',
commands: List[str]
) → NoneAppend the commands to the startup file for the specified device.
Args:
-
machine(Kathara.model.Machine.Machine): The device to update the startup file for. -
commands(str): The startup commands to append to the device.
Returns: None
Raises:
-
InvocationError: If the fs is None.
update_startup_file_from_string(
machine: 'MachinePackage.Machine',
commands_string: str
) → NoneAppend the command_string to the startup file for the specified device.
Args:
-
machine(Kathara.model.Machine.Machine): The device to update the startup file for. -
commands_string(str): The startup commands to add to the device.
Returns: None
Raises:
-
InvocationError: If the fs is None.
This file was automatically generated via lazydocs.
Website: kathara.org
Contact us: [email protected]