Code Duplication    Length = 22-22 lines in 2 locations

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

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 7139-7160 (lines=22) @@
7136
7137
        return self._send_xml_command(cmd)
7138
7139
    def move_task(self, task_id: str, *, slave_id: Optional[str] = None) -> Any:
7140
        """Move an existing task to another GMP slave scanner or the master
7141
7142
        Arguments:
7143
            task_id: UUID of the task to be moved
7144
            slave_id: UUID of slave to reassign the task to, empty for master.
7145
7146
        Returns:
7147
            The response. See :py:meth:`send_command` for details.
7148
        """
7149
        if not task_id:
7150
            raise RequiredArgument(
7151
                function=self.move_task.__name__, argument='task_id'
7152
            )
7153
7154
        cmd = XmlCommand("move_task")
7155
        cmd.set_attribute("task_id", task_id)
7156
7157
        if slave_id is not None:
7158
            cmd.set_attribute("slave_id", slave_id)
7159
7160
        return self._send_xml_command(cmd)
7161
7162
    def restore(self, entity_id: str) -> Any:
7163
        """Restore an entity from the trashcan