Exemple #1
0
    def arch(self, arch: Union[str, enums.Archs]):
        """
        The setter for the arch property.

        :param arch: The architecture of the operating system distro.
        """
        self._arch = validate.validate_arch(arch)
Exemple #2
0
    def arch(self, arch: Union[str, enums.Archs]):
        """
        The field is mainly relevant to PXE provisioning.
        See comments for arch property in distro.py, this works the same.

        :param arch: The new architecture to set.
        """
        self._arch = validate.validate_arch(arch)
Exemple #3
0
    def arch(self, arch: Union[str, enums.Archs]):
        """
        The field is mainly relevant to PXE provisioning.

        Using an alternative distro type allows for dhcpd.conf templating to "do the right thing" with those
        systems -- this also relates to bootloader configuration files which have different syntax for different
        distro types (because of the bootloaders).

        This field is named "arch" because mainly on Linux, we only care about the architecture, though if (in the
        future) new provisioning types are added, an arch value might be something like "bsd_x86".

        :param arch: The architecture of the operating system distro.
        """
        self._arch = validate.validate_arch(arch)
Exemple #4
0
def test_validate_arch(test_architecture, test_raise):
    # Arrange

    # Act
    with test_raise:
        result = validate.validate_arch(test_architecture)

        # Assert
        if isinstance(test_architecture, str):
            assert result.value == test_architecture
        elif isinstance(test_architecture, enums.Archs):
            assert result == test_architecture
        else:
            raise TypeError("result had a non expected result")