Code Duplication    Length = 24-24 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 4641-4664 (lines=24) @@
4638
4639
        return self._send_xml_command(cmd)
4640
4641
    def modify_config_set_name(self, config_id: str, name: str) -> Any:
4642
        """Modifies the name of an existing scan config
4643
4644
        Arguments:
4645
            config_id: UUID of scan config to modify.
4646
            name: New name for the config.
4647
        """
4648
        if not config_id:
4649
            raise RequiredArgument(
4650
                function=self.modify_config_set_name.__name__,
4651
                argument='config_id',
4652
            )
4653
4654
        if not name:
4655
            raise RequiredArgument(
4656
                function=self.modify_config_set_name.__name__, argument='name'
4657
            )
4658
4659
        cmd = XmlCommand("modify_config")
4660
        cmd.set_attribute("config_id", str(config_id))
4661
4662
        cmd.add_element("name", name)
4663
4664
        return self._send_xml_command(cmd)
4665
4666
    def modify_config_set_comment(
4667
        self, config_id: str, comment: Optional[str] = ""

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 6107-6130 (lines=24) @@
6104
6105
        return self._send_xml_command(cmd)
6106
6107
    def modify_config_set_name(self, config_id: str, name: str) -> Any:
6108
        """Modifies the name of an existing scan config
6109
6110
        Arguments:
6111
            config_id: UUID of scan config to modify.
6112
            name: New name for the config.
6113
        """
6114
        if not config_id:
6115
            raise RequiredArgument(
6116
                function=self.modify_config_set_name.__name__,
6117
                argument='config_id',
6118
            )
6119
6120
        if not name:
6121
            raise RequiredArgument(
6122
                function=self.modify_config_set_name.__name__, argument='name'
6123
            )
6124
6125
        cmd = XmlCommand("modify_config")
6126
        cmd.set_attribute("config_id", str(config_id))
6127
6128
        cmd.add_element("name", name)
6129
6130
        return self._send_xml_command(cmd)
6131
6132
    def modify_config_set_comment(
6133
        self, config_id: str, comment: Optional[str] = ""