Code Duplication    Length = 22-22 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 7107-7128 (lines=22) @@
7104
7105
        return self._send_xml_command(cmd)
7106
7107
    def move_task(self, task_id: str, *, slave_id: Optional[str] = None) -> Any:
7108
        """Move an existing task to another GMP slave scanner or the master
7109
7110
        Arguments:
7111
            task_id: UUID of the task to be moved
7112
            slave_id: UUID of slave to reassign the task to, empty for master.
7113
7114
        Returns:
7115
            The response. See :py:meth:`send_command` for details.
7116
        """
7117
        if not task_id:
7118
            raise RequiredArgument(
7119
                function=self.move_task.__name__, argument='task_id'
7120
            )
7121
7122
        cmd = XmlCommand("move_task")
7123
        cmd.set_attribute("task_id", task_id)
7124
7125
        if slave_id is not None:
7126
            cmd.set_attribute("slave_id", slave_id)
7127
7128
        return self._send_xml_command(cmd)
7129
7130
    def restore(self, entity_id: str) -> Any:
7131
        """Restore an entity from the trashcan

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 6178-6199 (lines=22) @@
6175
6176
        return self._send_xml_command(cmd)
6177
6178
    def move_task(self, task_id: str, *, slave_id: Optional[str] = None) -> Any:
6179
        """Move an existing task to another GMP slave scanner or the master
6180
6181
        Arguments:
6182
            task_id: UUID of the task to be moved
6183
            slave_id: UUID of slave to reassign the task to, empty for master.
6184
6185
        Returns:
6186
            The response. See :py:meth:`send_command` for details.
6187
        """
6188
        if not task_id:
6189
            raise RequiredArgument(
6190
                function=self.move_task.__name__, argument='task_id'
6191
            )
6192
6193
        cmd = XmlCommand("move_task")
6194
        cmd.set_attribute("task_id", task_id)
6195
6196
        if slave_id is not None:
6197
            cmd.set_attribute("slave_id", slave_id)
6198
6199
        return self._send_xml_command(cmd)
6200
6201
    def restore(self, entity_id: str) -> Any:
6202
        """Restore an entity from the trashcan