Passed
Pull Request — master (#97)
by
unknown
01:59
created

gmp.gmp.Gmp._connect()   A

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2018 Greenbone Networks GmbH
3
#
4
# SPDX-License-Identifier: GPL-3.0-or-later
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
"""
19
Module for communication with gvmd
20
"""
21
22
import logging
23
24
from lxml import etree
25
26
from gmp.error import GmpError
27
from gmp.xml import GmpCommandFactory
28
29
logger = logging.getLogger(__name__)
0 ignored issues
show
Coding Style Naming introduced by
The name logger does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
30
31
32
def arguments_to_string(kwargs):
33
    """Convert arguments
34
35
    Converts dictionaries into gmp arguments string
36
37
    Arguments:
38
        kwargs {dict} -- Arguments
39
40
    Returns:
41
        string -- Arguments as string
42
    """
43
    msg = ''
44
    for key, value in kwargs.items():
45
        msg += str(key) + '=\'' + str(value) + '\' '
46
47
    return msg
48
49
def _check_command_status(xml):
50
    """Check gmp response
51
52
    Look into the gmp response and check for the status in the root element
53
54
    Arguments:
55
        xml {string} -- XML-Source
56
57
    Returns:
58
        bool -- True if valid, otherwise False
59
    """
60
61
    if xml is 0 or xml is None:
62
        logger.error('XML Command is empty')
63
        return False
64
65
    try:
66
        parser = etree.XMLParser(encoding='utf-8', recover=True)
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named XMLParser.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
67
68
        root = etree.XML(xml, parser=parser)
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named XML.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
69
        status = root.attrib['status']
70
        return status is not None and status[0] == '2'
71
72
    except etree.Error as e:
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named Error.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Coding Style Naming introduced by
The name e does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
73
        logger.error('etree.XML(xml): %s', e)
74
        return False
75
76
77
class Gmp:
0 ignored issues
show
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
best-practice introduced by
Too many public methods (114/20)
Loading history...
78
    """Wrapper for Greenbone Management Protocol
79
    """
80
81
    def __init__(self, connection, transform=None):
82
        # GMP Message Creator
83
        self._generator = GmpCommandFactory()
84
        self._connection = connection
85
86
        self._connected = False
87
88
        # Is authenticated on gvm
89
        self._authenticated = False
90
91
        self._transform_callable = transform
92
93
    def _read(self):
94
        """Read a command response from gvmd
95
96
        Returns:
97
            <string> -- Response from server.
98
        """
99
        response = self._connection.read()
100
101
        logger.debug('read() %i Bytes response: %s', len(response), response)
102
103
        if response is None or len(str(response)) == 0:
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
104
            raise GmpError('Connection was closed by remote server')
105
106
        return response
107
108
    def _send(self, data):
109
        """Send a command to gsad
110
        """
111
        self._connect()
112
        self._connection.send(data)
113
114
    def _connect(self):
115
        if not self.is_connected():
116
            self._connection.connect()
117
            self._connected = True
118
119
    def _transform(self, data):
120
        transform = self._transform_callable
121
        if transform is None:
122
            return data
123
        return transform(data)
124
125
    def is_connected(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
126
        return self._connected
127
128
    def is_authenticated(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
129
        return self._authenticated
130
131
    def disconnect(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
132
        if self.is_connected():
133
            self._connection.disconnect()
134
            self._connected = False
135
136
    def send_command(self, cmd):
137
        """Send a command to gsad
138
        """
139
        self._send(cmd)
140
        response = self._read()
141
        return self._transform(response)
142
143
    def authenticate(self, username, password):
144
        """Authenticate on GVM.
145
146
        The generated authenticate command will be send to server.
147
        After that a response is read from socket.
148
149
        Keyword Arguments:
150
            username {str} -- Username
151
            password {str} -- Password
152
153
        Returns:
154
            <string> -- Response from server.
155
        """
156
        cmd = self._generator.create_authenticate_command(
157
            username=username, password=password)
158
159
        self._send(cmd)
160
        response = self._read()
161
162
        if _check_command_status(response):
163
            self._authenticated = True
164
165
        return self._transform(response)
166
167
    def create_agent(self, installer, signature, name, comment='', copy='',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (8/5)
Loading history...
168
                     howto_install='', howto_use=''):
169
        cmd = self._generator.create_agent_command(
170
            installer, signature, name, comment, copy, howto_install,
171
            howto_use)
172
        return self.send_command(cmd)
173
174
    def create_alert(self, name, condition, event, method, filter_id='',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (8/5)
Loading history...
175
                     copy='', comment=''):
176
        cmd = self._generator.create_alert_command(name, condition, event,
177
                                                   method, filter_id, copy,
178
                                                   comment)
179
        return self.send_command(cmd)
180
181
    def create_asset(self, name, asset_type, comment=''):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
182
        # TODO: Add the missing second method. Also the docs are not complete!
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
183
        cmd = self._generator.create_asset_command(name, asset_type, comment)
184
        return self.send_command(cmd)
185
186
    def create_config(self, copy_id, name):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
187
        cmd = self._generator.create_config_command(copy_id, name)
188
        return self.send_command(cmd)
189
190
    def create_credential(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
191
        cmd = self._generator.create_credential_command(name, kwargs)
192
        return self.send_command(cmd)
193
194
    def create_filter(self, name, make_unique, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
195
        cmd = self._generator.create_filter_command(name, make_unique,
196
                                                    kwargs)
197
        return self.send_command(cmd)
198
199
    def create_group(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
200
        cmd = self._generator.create_group_command(name, kwargs)
201
        return self.send_command(cmd)
202
203
    # TODO: Create notes with comment returns bogus element. Research
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
204
    def create_note(self, text, nvt_oid, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
205
        cmd = self._generator.create_note_command(text, nvt_oid, kwargs)
206
        return self.send_command(cmd)
207
208
    def create_override(self, text, nvt_oid, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
209
        cmd = self._generator.create_override_command(text, nvt_oid, kwargs)
210
        return self.send_command(cmd)
211
212
    def create_permission(self, name, subject_id, permission_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
213
        cmd = self._generator.create_permission_command(
214
            name, subject_id, permission_type, kwargs)
215
        return self.send_command(cmd)
216
217
    def create_port_list(self, name, port_range, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
218
        cmd = self._generator.create_port_list_command(name, port_range, kwargs)
219
        return self.send_command(cmd)
220
221
    def create_port_range(self, port_list_id, start, end, port_range_type,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (6/5)
Loading history...
222
                          comment=''):
223
        cmd = self._generator.create_port_range_command(
224
            port_list_id, start, end, port_range_type, comment)
225
        return self.send_command(cmd)
226
227
    def create_report(self, report_xml_string, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
228
        cmd = self._generator.create_report_command(report_xml_string, kwargs)
229
        return self.send_command(cmd)
230
231
    def create_role(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
232
        cmd = self._generator.create_role_command(name, kwargs)
233
        return self.send_command(cmd)
234
235
    def create_scanner(self, name, host, port, scanner_type, ca_pub,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (7/5)
Loading history...
236
                       credential_id, **kwargs):
237
        cmd = self._generator.create_scanner_command(name, host, port,
238
                                                     scanner_type, ca_pub,
239
                                                     credential_id, kwargs)
240
        return self.send_command(cmd)
241
242
    def create_schedule(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
243
        cmd = self._generator.create_schedule_command(name, kwargs)
244
        return self.send_command(cmd)
245
246
    def create_tag(self, name, resource_id, resource_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
247
        cmd = self._generator.create_tag_command(name, resource_id,
248
                                                 resource_type, kwargs)
249
        return self.send_command(cmd)
250
251
    def create_target(self, name, make_unique, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
252
        # TODO: Missing variables
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
253
        cmd = self._generator.create_target_command(name, make_unique, kwargs)
254
        return self.send_command(cmd)
255
256
    def create_task(self, name, config_id, target_id, scanner_id,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (7/5)
Loading history...
257
                    alert_ids=None, comment=''):
258
        if alert_ids is None:
259
            alert_ids = []
260
        cmd = self._generator.create_task_command(
261
            name, config_id, target_id, scanner_id, alert_ids, comment)
262
        return self.send_command(cmd)
263
264
    def create_user(self, name, password, copy='', hosts_allow='0',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
265
                    ifaces_allow='0', role_ids=(), hosts=None, ifaces=None):
266
        cmd = self._generator.create_user_command(
267
            name, password, copy, hosts_allow, ifaces_allow, role_ids, hosts,
268
            ifaces)
269
        return self.send_command(cmd)
270
271
    def delete_agent(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
272
        cmd = '<delete_agent {0}/>'.format(arguments_to_string(kwargs))
273
        return self.send_command(cmd)
274
275
    def delete_alert(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
276
        cmd = '<delete_alert {0}/>'.format(arguments_to_string(kwargs))
277
        return self.send_command(cmd)
278
279
    def delete_asset(self, asset_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
280
        cmd = '<delete_asset asset_id="{0}" ultimate="{1}"/>'.format(
281
            asset_id, ultimate)
282
        return self.send_command(cmd)
283
284
    def delete_config(self, config_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
285
        cmd = '<delete_config config_id="{0}" ultimate="{1}"/>'.format(
286
            config_id, ultimate)
287
        return self.send_command(cmd)
288
289
    def delete_credential(self, credential_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
290
        cmd = '<delete_credential credential_id="{0}" ultimate="{1}"/>'.format(
291
            credential_id, ultimate)
292
        return self.send_command(cmd)
293
294
    def delete_filter(self, filter_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
295
        cmd = '<delete_filter filter_id="{0}" ultimate="{1}"/>'.format(
296
            filter_id, ultimate)
297
        return self.send_command(cmd)
298
299
    def delete_group(self, group_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
300
        cmd = '<delete_group group_id="{0}" ultimate="{1}"/>'.format(
301
            group_id, ultimate)
302
        return self.send_command(cmd)
303
304
    def delete_note(self, note_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
305
        cmd = '<delete_note note_id="{0}" ultimate="{1}"/>'.format(
306
            note_id, ultimate)
307
        return self.send_command(cmd)
308
309
    def delete_override(self, override_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
310
        cmd = '<delete_override override_id="{0}" ultimate="{1}"/>'.format(
311
            override_id, ultimate)
312
        return self.send_command(cmd)
313
314
    def delete_permission(self, permission_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
315
        cmd = '<delete_permission permission_id="{0}" ultimate="{1}"/>'.format(
316
            permission_id, ultimate)
317
        return self.send_command(cmd)
318
319
    def delete_port_list(self, port_list_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
320
        cmd = '<delete_port_list port_list_id="{0}" ultimate="{1}"/>'.format(
321
            port_list_id, ultimate)
322
        return self.send_command(cmd)
323
324
    def delete_port_range(self, port_range_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
325
        cmd = '<delete_port_range port_range_id="{0}"/>'.format(port_range_id)
326
        return self.send_command(cmd)
327
328
    def delete_report(self, report_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
329
        cmd = '<delete_report report_id="{0}"/>'.format(report_id)
330
        return self.send_command(cmd)
331
332
    def delete_report_format(self, report_format_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
333
        cmd = '<delete_report_format report_format_id="{0}" ' \
334
            'ultimate="{1}"/>'.format(report_format_id, ultimate)
335
        return self.send_command(cmd)
336
337
    def delete_role(self, role_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
338
        cmd = '<delete_role role_id="{0}" ultimate="{1}"/>'.format(
339
            role_id, ultimate)
340
        return self.send_command(cmd)
341
342
    def delete_scanner(self, scanner_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
343
        cmd = '<delete_scanner scanner_id="{0}" ultimate="{1}"/>'.format(
344
            scanner_id, ultimate)
345
        return self.send_command(cmd)
346
347
    def delete_schedule(self, schedule_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
348
        # if self.ask_yes_or_no('Are you sure to delete this schedule? '):
349
        cmd = '<delete_schedule schedule_id="{0}" ultimate="{1}"/>'.format(
350
            schedule_id, ultimate)
351
        return self.send_command(cmd)
352
353
    def delete_tag(self, tag_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
354
        cmd = '<delete_tag tag_id="{0}" ultimate="{1}"/>'.format(
355
            tag_id, ultimate)
356
        return self.send_command(cmd)
357
358
    def delete_target(self, target_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
359
        cmd = '<delete_target target_id="{0}" ultimate="{1}"/>'.format(
360
            target_id, ultimate)
361
        return self.send_command(cmd)
362
363
    def delete_task(self, task_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
364
        cmd = '<delete_task task_id="{0}" ultimate="{1}"/>'.format(
365
            task_id, ultimate)
366
        return self.send_command(cmd)
367
368
    def delete_user(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
369
        user_id = kwargs.get('user_id', '')
370
        if user_id:
371
            user_id = ' user_id="%s"' % user_id
372
373
        name = kwargs.get('name', '')
374
        if name:
375
            name = ' name="%s"' % name
376
377
        inheritor_id = kwargs.get('inheritor_id', '')
378
        if inheritor_id:
379
            inheritor_id = ' inheritor_id="%s"' % inheritor_id
380
381
        inheritor_name = kwargs.get('inheritor_name', '')
382
        if inheritor_name:
383
            inheritor_name = ' inheritor_name="%s"' % inheritor_name
384
385
        cmd = '<delete_user{0}{1}{2}{3}/>'.format(
386
            user_id, name, inheritor_id, inheritor_name)
387
        return self.send_command(cmd)
388
389
    def describe_auth(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
390
        return self.send_command('<describe_auth/>')
391
392
    def empty_trashcan(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
393
        return self.send_command('<empty_trashcan/>')
394
395
    def get_agents(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
396
        cmd = '<get_agents {0}/>'.format(arguments_to_string(kwargs))
397
        return self.send_command(cmd)
398
399
    def get_aggregates(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
400
        cmd = '<get_aggregates {0}/>'.format(arguments_to_string(kwargs))
401
        return self.send_command(cmd)
402
403
    def get_alerts(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
404
        cmd = '<get_alerts {0}/>'.format(arguments_to_string(kwargs))
405
        return self.send_command(cmd)
406
407
    def get_assets(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
408
        cmd = '<get_assets {0}/>'.format(arguments_to_string(kwargs))
409
        return self.send_command(cmd)
410
411
    def get_credentials(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
412
        cmd = '<get_credentials {0}/>'.format(arguments_to_string(kwargs))
413
        return self.send_command(cmd)
414
415
    def get_configs(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
416
        cmd = '<get_configs {0}/>'.format(arguments_to_string(kwargs))
417
        return self.send_command(cmd)
418
419
    def get_feeds(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
420
        cmd = '<get_feeds {0}/>'.format(arguments_to_string(kwargs))
421
        return self.send_command(cmd)
422
423
    def get_filters(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
424
        cmd = '<get_filters {0}/>'.format(arguments_to_string(kwargs))
425
        return self.send_command(cmd)
426
427
    def get_groups(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
428
        cmd = '<get_groups {0}/>'.format(arguments_to_string(kwargs))
429
        return self.send_command(cmd)
430
431
    def get_info(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
432
        cmd = '<get_info {0}/>'.format(arguments_to_string(kwargs))
433
        return self.send_command(cmd)
434
435
    def get_notes(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
436
        cmd = '<get_notes {0}/>'.format(arguments_to_string(kwargs))
437
        return self.send_command(cmd)
438
439
    def get_nvts(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
440
        cmd = '<get_nvts {0}/>'.format(arguments_to_string(kwargs))
441
        return self.send_command(cmd)
442
443
    def get_nvt_families(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
444
        cmd = '<get_nvt_families {0}/>'.format(arguments_to_string(kwargs))
445
        return self.send_command(cmd)
446
447
    def get_overrides(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
448
        cmd = '<get_overrides {0}/>'.format(arguments_to_string(kwargs))
449
        return self.send_command(cmd)
450
451
    def get_permissions(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
452
        cmd = '<get_permissions {0}/>'.format(arguments_to_string(kwargs))
453
        return self.send_command(cmd)
454
455
    def get_port_lists(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
456
        cmd = '<get_port_lists {0}/>'.format(arguments_to_string(kwargs))
457
        return self.send_command(cmd)
458
459
    def get_preferences(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
460
        cmd = '<get_preferences {0}/>'.format(arguments_to_string(kwargs))
461
        return self.send_command(cmd)
462
463
    def get_reports(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
464
        cmd = '<get_reports {0}/>'.format(arguments_to_string(kwargs))
465
        return self.send_command(cmd)
466
467
    def get_report_formats(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
468
        cmd = '<get_report_formats {0}/>'.format(arguments_to_string(kwargs))
469
        return self.send_command(cmd)
470
471
    def get_results(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
472
        cmd = '<get_results {0}/>'.format(arguments_to_string(kwargs))
473
        return self.send_command(cmd)
474
475
    def get_roles(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
476
        cmd = '<get_roles {0}/>'.format(arguments_to_string(kwargs))
477
        return self.send_command(cmd)
478
479
    def get_scanners(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
480
        cmd = '<get_scanners {0}/>'.format(arguments_to_string(kwargs))
481
        return self.send_command(cmd)
482
483
    def get_schedules(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
484
        cmd = '<get_schedules {0}/>'.format(arguments_to_string(kwargs))
485
        return self.send_command(cmd)
486
487
    def get_settings(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
488
        cmd = '<get_settings {0}/>'.format(arguments_to_string(kwargs))
489
        return self.send_command(cmd)
490
491
    def get_system_reports(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
492
        cmd = '<get_system_reports {0}/>'.format(arguments_to_string(kwargs))
493
        return self.send_command(cmd)
494
495
    def get_tags(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
496
        cmd = '<get_tags {0}/>'.format(arguments_to_string(kwargs))
497
        return self.send_command(cmd)
498
499
    def get_targets(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
500
        cmd = '<get_targets {0}/>'.format(arguments_to_string(kwargs))
501
        return self.send_command(cmd)
502
503
    def get_tasks(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
504
        cmd = '<get_tasks {0}/>'.format(arguments_to_string(kwargs))
505
        return self.send_command(cmd)
506
507
    def get_users(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
508
        cmd = '<get_users {0}/>'.format(arguments_to_string(kwargs))
509
        return self.send_command(cmd)
510
511
    def get_version(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
512
        return self.send_command('<get_version/>')
513
514
    def help(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
515
        cmd = '<help {0} />'.format(arguments_to_string(kwargs))
516
        return self.send_command(cmd)
517
518
    def modify_agent(self, agent_id, name='', comment=''):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
519
        cmd = self._generator.modify_agent_command(agent_id, name, comment)
520
        return self.send_command(cmd)
521
522
    def modify_alert(self, alert_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
523
        cmd = self._generator.modify_alert_command(alert_id, kwargs)
524
        return self.send_command(cmd)
525
526
    def modify_asset(self, asset_id, comment):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
527
        cmd = '<modify_asset asset_id="%s"><comment>%s</comment>' \
528
              '</modify_asset>' % (asset_id, comment)
529
        return self.send_command(cmd)
530
531
    def modify_auth(self, group_name, auth_conf_settings):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
532
        cmd = self._generator.modify_auth_command(group_name,
533
                                                  auth_conf_settings)
534
        return self.send_command(cmd)
535
536
    def modify_config(self, selection, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
537
        cmd = self._generator.modify_config_command(selection, kwargs)
538
        return self.send_command(cmd)
539
540
    def modify_credential(self, credential_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
541
        cmd = self._generator.modify_credential_command(
542
            credential_id, kwargs)
543
        return self.send_command(cmd)
544
545
    def modify_filter(self, filter_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
546
        cmd = self._generator.modify_filter_command(filter_id, kwargs)
547
        return self.send_command(cmd)
548
549
    def modify_group(self, group_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
550
        cmd = self._generator.modify_group_command(group_id, kwargs)
551
        return self.send_command(cmd)
552
553
    def modify_note(self, note_id, text, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
554
        cmd = self._generator.modify_note_command(note_id, text, kwargs)
555
        return self.send_command(cmd)
556
557
    def modify_override(self, override_id, text, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
558
        cmd = self._generator.modify_override_command(override_id, text,
559
                                                      kwargs)
560
        return self.send_command(cmd)
561
562
    def modify_permission(self, permission_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
563
        cmd = self._generator.modify_permission_command(
564
            permission_id, kwargs)
565
        return self.send_command(cmd)
566
567
    def modify_port_list(self, port_list_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
568
        cmd = self._generator.modify_port_list_command(port_list_id, kwargs)
569
        return self.send_command(cmd)
570
571
    def modify_report(self, report_id, comment):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
572
        cmd = '<modify_report report_id="{0}"><comment>{1}</comment>' \
573
              '</modify_report>'.format(report_id, comment)
574
        return self.send_command(cmd)
575
576
    def modify_report_format(self, report_format_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
577
        cmd = self._generator.modify_report_format_command(report_format_id,
578
                                                           kwargs)
579
        return self.send_command(cmd)
580
581
    def modify_role(self, role_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
582
        cmd = self._generator.modify_role_command(role_id, kwargs)
583
        return self.send_command(cmd)
584
585
    def modify_scanner(self, scanner_id, host, port, scanner_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
586
        cmd = self._generator.modify_scanner_command(scanner_id, host, port,
587
                                                     scanner_type, kwargs)
588
        return self.send_command(cmd)
589
590
    def modify_schedule(self, schedule_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
591
        cmd = self._generator.modify_schedule_command(schedule_id, kwargs)
592
        return self.send_command(cmd)
593
594
    def modify_setting(self, setting_id, name, value):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
595
        cmd = '<modify_setting setting_id="{0}"><name>{1}</name>' \
596
              '<value>{2}</value></modify_setting>' \
597
              ''.format(setting_id, name, value)
598
        return self.send_command(cmd)
599
600
    def modify_tag(self, tag_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
601
        cmd = self._generator.modify_tag_command(tag_id, kwargs)
602
        return self.send_command(cmd)
603
604
    def modify_target(self, target_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
605
        cmd = self._generator.modify_target_command(target_id, kwargs)
606
        return self.send_command(cmd)
607
608
    def modify_task(self, task_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
609
        cmd = self._generator.modify_task_command(task_id, kwargs)
610
        return self.send_command(cmd)
611
612
    def modify_user(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
613
        cmd = self._generator.modify_user_command(kwargs)
614
        return self.send_command(cmd)
615
616
    def move_task(self, task_id, slave_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
617
        cmd = '<move_task task_id="{0}" slave_id="{1}"/>'.format(
618
            task_id, slave_id)
619
        return self.send_command(cmd)
620
621
    def restore(self, entity_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
622
        cmd = '<restore id="{0}"/>'.format(entity_id)
623
        return self.send_command(cmd)
624
625
    def resume_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
626
        cmd = '<resume_task task_id="{0}"/>'.format(task_id)
627
        return self.send_command(cmd)
628
629
    def start_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
630
        cmd = '<start_task task_id="{0}"/>'.format(task_id)
631
        return self.send_command(cmd)
632
633
    def stop_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
634
        cmd = '<stop_task task_id="{0}"/>'.format(task_id)
635
        return self.send_command(cmd)
636
637
    def sync_cert(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
638
        cmd = '<sync_cert/>'
639
        return self.send_command(cmd)
640
641
    def sync_config(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
642
        cmd = '<sync_config/>'
643
        return self.send_command(cmd)
644
645
    def sync_feed(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
646
        cmd = '<sync_feed/>'
647
        return self.send_command(cmd)
648
649
    def sync_scap(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
650
        cmd = '<sync_scap/>'
651
        return self.send_command(cmd)
652
653
    def test_alert(self, alert_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
654
        cmd = '<test_alert alert_id="{0}"/>'.format(alert_id)
655
        return self.send_command(cmd)
656
657
    def verify_agent(self, agent_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
658
        cmd = '<verify_agent agent_id="{0}"/>'.format(agent_id)
659
        return self.send_command(cmd)
660
661
    def verify_report_format(self, report_format_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
662
        cmd = '<verify_report_format report_format_id="{0}"/>'.format(
663
            report_format_id)
664
        return self.send_command(cmd)
665
666
    def verify_scanner(self, scanner_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
667
        cmd = '<verify_scanner scanner_id="{0}"/>'.format(scanner_id)
668
        return self.send_command(cmd)
669