Skip to content

Kathara.foundation.model.LabFilesystemMixin

tcaiazzi edited this page Jul 29, 2025 · 1 revision

module Kathara.foundation.model.LabFilesystemMixin


class LabFilesystemMixin

Abstraction to manage filesystems of network scenarios.

Attributes:

  • fs (FS): An object referencing a filesystem. Can be both real OS or a memory fs.

method LabFilesystemMixin.__init__

__init__()

method LabFilesystemMixin.create_startup_file_from_list

create_startup_file_from_list(
    machine: 'MachinePackage.Machine',
    commands: List[str]
) → None

Create 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.

method LabFilesystemMixin.create_startup_file_from_path

create_startup_file_from_path(
    machine: 'MachinePackage.Machine',
    src_path: str
) → None

Create 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.

method LabFilesystemMixin.create_startup_file_from_stream

create_startup_file_from_stream(
    machine: 'MachinePackage.Machine',
    stream: typing.BinaryIO | typing.TextIO
) → None

Create 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.

method LabFilesystemMixin.create_startup_file_from_string

create_startup_file_from_string(
    machine: 'MachinePackage.Machine',
    commands_string: str
) → None

Create 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.

method LabFilesystemMixin.update_startup_file_from_list

update_startup_file_from_list(
    machine: 'MachinePackage.Machine',
    commands: List[str]
) → None

Append 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.

method LabFilesystemMixin.update_startup_file_from_string

update_startup_file_from_string(
    machine: 'MachinePackage.Machine',
    commands_string: str
) → None

Append 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.

Clone this wiki locally