示例#1
0
文件: system.py 项目: nodeg/cobbler
    def power_id(self, power_id: str):
        """
        TODO

        :param power_id:
        """
        if not isinstance(power_id, str):
            raise TypeError(
                "Field power_id of object system needs to be of type str!")
        utils.safe_filter(power_id)
        self._power_id = power_id
示例#2
0
文件: system.py 项目: nodeg/cobbler
    def power_address(self, power_address: str):
        """
        TODO

        :param power_address:
        """
        if not isinstance(power_address, str):
            raise TypeError(
                "Field power_address of object system needs to be of type str!"
            )
        utils.safe_filter(power_address)
        self._power_address = power_address
示例#3
0
文件: system.py 项目: nodeg/cobbler
    def power_identity_file(self, power_identity_file: str):
        """
        TODO

        :param power_identity_file:
        """
        if not isinstance(power_identity_file, str):
            raise TypeError(
                "Field power_identity_file of object system needs to be of type str!"
            )
        utils.safe_filter(power_identity_file)
        self._power_identity_file = power_identity_file
示例#4
0
 def set_power_id(self, power_id):
     if power_id is None:
         power_id = ""
     utils.safe_filter(power_id)
     self.power_id = power_id
     return True
示例#5
0
 def set_power_address(self, power_address):
     if power_address is None:
         power_address = ""
     utils.safe_filter(power_address)
     self.power_address = power_address
     return True
示例#6
0
 def set_power_user(self, power_user):
     if power_user is None:
         power_user = ""
     utils.safe_filter(power_user)
     self.power_user = power_user
     return True
示例#7
0
 def set_power_pass(self, power_pass):
     if power_pass is None:
         power_pass = ""
     utils.safe_filter(power_pass)
     self.power_pass = power_pass
示例#8
0
 def set_power_pass(self, power_pass):
     if power_pass is None:
         power_pass = ""
     utils.safe_filter(power_pass)
     self.power_pass = power_pass
示例#9
0
def test_safe_filter(test_input, expected_exception):
    # Arrange, Act & Assert
    with expected_exception:
        assert utils.safe_filter(test_input) is None
示例#10
0
 def set_power_options(self, power_options):
     if power_options is None:
         power_options = ""
     utils.safe_filter(power_options)
     self.power_options = power_options
示例#11
0
 def set_power_identity_file(self, power_identity_file):
     if power_identity_file is None:
         power_identity_file = ""
     utils.safe_filter(power_identity_file)
     self.power_identity_file = power_identity_file