Passed
Pull Request — master (#116)
by Juan José
01:51
created

gmp.xml.XmlCommandElement.append_xml_str()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module 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...
coding-style introduced by
Too many lines in module (1600/1000)
Loading history...
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
import defusedxml.lxml as secET
20
21
from lxml import etree
22
23
FILTER_NAMES = [
24
    'Agent',
25
    'Alert',
26
    'Asset',
27
    'Config',
28
    'Credential',
29
    'Filter',
30
    'Group',
31
    'Note',
32
    'Override',
33
    'Permission',
34
    'Port List',
35
    'Report',
36
    'Report Format',
37
    'Result',
38
    'Role',
39
    'Schedule',
40
    'SecInfo',
41
    'Tag',
42
    'Target',
43
    'Task',
44
    'User',
45
]
46
47
class XmlCommandElement:
0 ignored issues
show
Coding Style introduced by
This class 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...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
48
49
    def __init__(self, element):
50
        self._element = element
51
52
    def add_element(self, name, text=None, attrs=None):
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...
53
        node = etree.SubElement(self._element, name, attrib=attrs)
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
54
        node.text = text
55
        return XmlCommandElement(node)
56
57
    def set_attribute(self, 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...
58
        self._element.set(name, value)
59
60
    def append_xml_str(self, xml_text):
61
        """Append a xml element in string format."""
62
        node = secET.fromstring(xml_text)
63
        self._element.append(node)
64
65
    def to_string(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...
66
        return etree.tostring(self._element).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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
    def __str__(self):
69
        return self.to_string()
70
71
72
class XmlCommand(XmlCommandElement):
0 ignored issues
show
Coding Style introduced by
This class 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...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
73
74
    def __init__(self, name):
75
        super().__init__(etree.Element(name))
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
76
77
78
class _GmpCommandFactory:
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 (40/20)
Loading history...
79
80
    """Factory to create gmp - Greenbone Manangement Protocol - commands
81
    """
82
83
    def create_agent_command(self, installer, signature, 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...
best-practice introduced by
Too many arguments (8/5)
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
84
                             copy='', howto_install='', howto_use=''):
85
86
        cmd = XmlCommand('create_agent')
87
        cmd.add_element('installer', installer)
88
        cmd.add_element('signature', signature)
89
        cmd.add_element('name', name)
90
91
        if comment:
92
            cmd.add_element('comment', comment)
93
94
        if copy:
95
            cmd.add_element('copy', copy)
96
97
        if howto_install:
98
            cmd.add_element('howto_install', howto_install)
99
100
        if howto_use:
101
            cmd.add_element('howto_use', howto_use)
102
103
        return cmd.to_string()
104
105
    def create_alert_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (16/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
106
                             copy='', comment=''):
107
108
        cmd = XmlCommand('create_alert')
109
        cmd.add_element('name', name)
110
111
        if len(condition) > 1:
112
            conditions = cmd.add_element('condition', condition[0])
113
            for value, key in condition[1].items():
114
                _data = conditions.add_element('data', value)
115
                _data.add_element('name', key)
116
117
        elif condition[0] == "Always":
118
            conditions = cmd.add_element('condition', condition[0])
119
120
        if len(event) > 1:
121
            events = cmd.add_element('event', event[0])
122
            for value, key in event[1].items():
123
                _data = events.add_element('data', value)
124
                _data.add_element('name', key)
125
126
        if len(method) > 1:
127
            methods = cmd.add_element('method', method[0])
128
            for value, key in method[1].items():
129
                _data = methods.add_element('data', value)
130
                _data.add_element('name', key)
131
132
        if filter_id:
133
            cmd.add_element('filter', attrs={'id': filter_id})
134
135
        if copy:
136
            cmd.add_element('copy', copy)
137
138
        if comment:
139
            cmd.add_element('comment', comment)
140
141
        return cmd.to_string()
142
143
    def create_asset_command(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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
144
        if asset_type not in ('host', 'os'):
145
            raise ValueError('create_asset requires asset_type to be either '
146
                             'host or os')
147
        cmd = XmlCommand('create_asset')
148
        asset = cmd.add_element('asset')
149
        asset.add_element('type', asset_type)
150
        asset.add_element('name', name)
151
152
        if comment:
153
            asset.add_element('comment', comment)
154
155
        return cmd.to_string()
156
157
    def create_authenticate_command(self, username, password):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
158
        """Generates string for authentification on gvmd
159
160
        Creates the gmp authentication xml string.
161
        Inserts the username and password into it.
162
163
        Keyword Arguments:
164
            username {str} -- Username for GVM User
165
            password {str} -- Password for GVM User
166
        """
167
        cmd = XmlCommand('authenticate')
168
169
        credentials = cmd.add_element('credentials')
170
        credentials.add_element('username', username)
171
        credentials.add_element('password', password)
172
173
        return cmd.to_string()
174
175
    def create_config_command(self, copy_id, name):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
176
        """Generates xml string for create config on gvmd."""
177
        cmd = XmlCommand('create_config')
178
        cmd.add_element('copy', copy_id)
179
        cmd.add_element('name', name)
180
181
        return cmd.to_string()
182
183
    def create_credential_command(self, name, kwargs):
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (22/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
184
        """Generates xml string for create credential on gvmd."""
185
        cmd = XmlCommand('create_credential')
186
        cmd.add_element('name', name)
187
188
        comment = kwargs.get('comment', '')
189
        if comment:
190
            cmd.add_element('comment', comment)
191
192
        copy = kwargs.get('copy', '')
193
        if copy:
194
            cmd.add_element('copy', copy)
195
196
        allow_insecure = kwargs.get('allow_insecure', '')
197
        if allow_insecure:
198
            cmd.add_element('allow_insecure', allow_insecure)
199
200
        certificate = kwargs.get('certificate', '')
201
        if certificate:
202
            cmd.add_element('certificate', certificate)
203
204
        key = kwargs.get('key', '')
205
        if key:
206
            phrase = key['phrase']
207
            private = key['private']
208
            if not phrase:
209
                raise ValueError('create_credential requires a phrase element')
210
            if not private:
211
                raise ValueError('create_credential requires a '
212
                                 'private element')
213
214
            _xmlkey = cmd.add_element('key')
215
            _xmlkey.add_element('phrase', phrase)
216
            _xmlkey.add_element('private', private)
217
218
        login = kwargs.get('login', '')
219
        if login:
220
            cmd.add_element('login', login)
221
222
        password = kwargs.get('password', '')
223
        if password:
224
            cmd.add_element('password', password)
225
226
        auth_algorithm = kwargs.get('auth_algorithm', '')
227
        if auth_algorithm:
228
            if auth_algorithm not in ('md5', 'sha1'):
229
                raise ValueError('create_credential requires auth_algorithm '
230
                                 'to be either md5 or sha1')
231
            cmd.add_element('auth_algorithm', auth_algorithm)
232
233
        community = kwargs.get('community', '')
234
        if community:
235
            cmd.add_element('community', community)
236
237
        privacy = kwargs.get('privacy', '')
238
        if privacy:
239
            algorithm = privacy.algorithm
240
            if algorithm not in ('aes', 'des'):
241
                raise ValueError('create_credential requires algorithm '
242
                                 'to be either aes or des')
243
            p_password = privacy.password
244
            _xmlprivacy = cmd.add_element('privacy')
245
            _xmlprivacy.add_element('algorithm', algorithm)
246
            _xmlprivacy.add_element('password', p_password)
247
248
        cred_type = kwargs.get('type', '')
249
        if cred_type:
250
            if cred_type not in ('cc', 'snmp', 'up', 'usk'):
251
                raise ValueError('create_credential requires type '
252
                                 'to be either cc, snmp, up or usk')
253
            cmd.add_element('type', cred_type)
254
255
        return cmd.to_string()
256
257
    def create_filter_command(self, name, make_unique, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
258
        """Generates xml string for create filter on gvmd."""
259
260
        cmd = XmlCommand('create_filter')
261
        _xmlname = cmd.add_element('name', name)
262
        if make_unique:
263
            _xmlname.add_element('make_unique', '1')
264
        else:
265
            _xmlname.add_element('make_unique', '0')
266
267
        comment = kwargs.get('comment', '')
268
        if comment:
269
            cmd.add_element('comment', comment)
270
271
        copy = kwargs.get('copy', '')
272
        if copy:
273
            cmd.add_element('copy', copy)
274
275
        term = kwargs.get('term', '')
276
        if term:
277
            cmd.add_element('term', term)
278
279
        filter_type = kwargs.get('type', '')
280
        if filter_type:
281
            if filter_type not in FILTER_NAMES:
282
                raise ValueError('create_filter requires type '
283
                                 'to be either cc, snmp, up or usk')
284
            cmd.add_element('type', filter_type)
285
286
        return cmd.to_string()
287
288
    def create_group_command(self, name, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
289
        """Generates xml string for create group on gvmd."""
290
291
        cmd = XmlCommand('create_group')
292
        cmd.add_element('name', name)
293
294
        comment = kwargs.get('comment', '')
295
        if comment:
296
            cmd.add_element('comment', comment)
297
298
        copy = kwargs.get('copy', '')
299
        if copy:
300
            cmd.add_element('copy', copy)
301
302
        special = kwargs.get('special', '')
303
        if special:
304
            _xmlspecial = cmd.add_element('specials')
305
            _xmlspecial.add_element('full')
306
307
        users = kwargs.get('users', '')
308
        if users:
309
            cmd.add_element('users', users)
310
311
        return cmd.to_string()
312
313
    def create_note_command(self, text, nvt_oid, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
314
        """Generates xml string for create note on gvmd."""
315
316
        cmd = XmlCommand('create_note')
317
        cmd.add_element('text', text)
318
        cmd.add_element('nvt', attrs={"oid": nvt_oid})
319
320
        active = kwargs.get('active', '')
321
        if active:
322
            cmd.add_element('active', active)
323
324
        comment = kwargs.get('comment', '')
325
        if comment:
326
            cmd.add_element('comment', comment)
327
328
        copy = kwargs.get('copy', '')
329
        if copy:
330
            cmd.add_element('copy', copy)
331
332
        hosts = kwargs.get('hosts', '')
333
        if hosts:
334
            cmd.add_element('hosts', hosts)
335
336
        port = kwargs.get('port', '')
337
        if port:
338
            cmd.add_element('port', port)
339
340
        result_id = kwargs.get('result_id', '')
341
        if result_id:
342
            cmd.add_element('result', attrs={'id': result_id})
343
344
        severity = kwargs.get('severity', '')
345
        if severity:
346
            cmd.add_element('severity', severity)
347
348
        task_id = kwargs.get('task_id', '')
349
        if task_id:
350
            cmd.add_element('task', attrs={'id': task_id})
351
352
        threat = kwargs.get('threat', '')
353
        if threat:
354
            cmd.add_element('threat', threat)
355
356
        return cmd.to_string()
357
358
    def create_override_command(self, text, nvt_oid, kwargs):
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (17/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
359
        """Generates xml string for create override on gvmd."""
360
361
        cmd = XmlCommand('create_override')
362
        cmd.add_element('text', text)
363
        cmd.add_element('nvt', attrs={'oid': nvt_oid})
364
365
        active = kwargs.get('active', '')
366
        if active:
367
            cmd.add_element('active', active)
368
369
        comment = kwargs.get('comment', '')
370
        if comment:
371
            cmd.add_element('comment', comment)
372
373
        copy = kwargs.get('copy', '')
374
        if copy:
375
            cmd.add_element('copy', copy)
376
377
        hosts = kwargs.get('hosts', '')
378
        if hosts:
379
            cmd.add_element('hosts', hosts)
380
381
        port = kwargs.get('port', '')
382
        if port:
383
            cmd.add_element('port', port)
384
385
        result_id = kwargs.get('result_id', '')
386
        if result_id:
387
            cmd.add_element('result', attrs={'id': result_id})
388
389
        severity = kwargs.get('severity', '')
390
        if severity:
391
            cmd.add_element('severity', severity)
392
393
        new_severity = kwargs.get('new_severity', '')
394
        if new_severity:
395
            cmd.add_element('new_severity', new_severity)
396
397
        task_id = kwargs.get('task_id', '')
398
        if task_id:
399
            cmd.add_element('task', attrs={'id': task_id})
400
401
        threat = kwargs.get('threat', '')
402
        if threat:
403
            cmd.add_element('threat', threat)
404
405
        new_threat = kwargs.get('new_threat', '')
406
        if new_threat:
407
            cmd.add_element('new_threat', new_threat)
408
409
        return cmd.to_string()
410
411
    def create_permission_command(self, name, subject_id, 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...
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
412
        # pretty(gmp.create_permission('get_version',
413
        # 'cc9cac5e-39a3-11e4-abae-406186ea4fc5', 'role'))
414
        # libs.gvm_connection.GMPError: Error in NAME
415
        # TODO: Research why!!
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
416
417
        if not name:
418
            raise ValueError('create_permission requires a name element')
419
        if not subject_id:
420
            raise ValueError('create_permission requires a subject_id element')
421
        if type not in ('user', 'group', 'role'):
422
            raise ValueError('create_permission requires type '
423
                             'to be either user, group or role')
424
425
        cmd = XmlCommand('create_permission')
426
        cmd.add_element('name', name)
427
        _xmlsubject = cmd.add_element('subject', attrs={'id': subject_id})
428
        _xmlsubject.add_element('type', type)
429
430
        comment = kwargs.get('comment', '')
431
        if comment:
432
            cmd.add_element('comment', comment)
433
434
        copy = kwargs.get('copy', '')
435
        if copy:
436
            cmd.add_element('copy', copy)
437
438
        resource = kwargs.get('resource', '')
439
        if resource:
440
            resource_id = resource.id
441
            resource_type = resource.type
442
            _xmlresource = cmd.add_element('resource',
443
                                           attrs={'id': resource_id})
444
            _xmlresource.add_element('type', resource_type)
445
446
        return cmd.to_string()
447
448
    def create_port_list_command(self, name, port_range, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
449
        """Generates xml string for create port list on gvmd."""
450
        if not name:
451
            raise ValueError('create_port_list requires a name element')
452
        if not port_range:
453
            raise ValueError('create_port_list requires a port_range element')
454
455
        cmd = XmlCommand('create_port_list')
456
        cmd.add_element('name', name)
457
        cmd.add_element('port_range', port_range)
458
459
        comment = kwargs.get('comment', '')
460
        if comment:
461
            cmd.add_element('comment', comment)
462
463
        copy = kwargs.get('copy', '')
464
        if copy:
465
            cmd.add_element('copy', copy)
466
467
        return cmd.to_string()
468
469
    def create_port_range_command(self, port_list_id, start, end, type,
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
best-practice introduced by
Too many arguments (6/5)
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
470
                                  comment=''):
471
        """Generates xml string for create port range on gvmd."""
472
473
        if not port_list_id:
474
            raise ValueError('create_port_range requires '
475
                             'a port_list_id element')
476
        if not type:
477
            raise ValueError('create_port_range requires a type element')
478
479
        cmd = XmlCommand('create_port_range')
480
        cmd.add_element('port_list', attrs={'id': port_list_id})
481
        cmd.add_element('start', start)
482
        cmd.add_element('end', end)
483
        cmd.add_element('type', type)
484
485
        if comment:
486
            cmd.add_element('comment', comment)
487
488
        return cmd.to_string()
489
490
    def create_report_command(self, report_xml_string, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
491
        """Generates xml string for create report on gvmd."""
492
493
        if not report_xml_string:
494
            raise ValueError('create_report requires a report')
495
496
        task_id = kwargs.get('task_id', '')
497
        task_name = kwargs.get('task_name', '')
498
499
        cmd = XmlCommand('create_report')
500
        comment = kwargs.get('comment', '')
501
        if task_id:
502
            cmd.add_element('task', attrs={'id': task_id})
503
        elif task_name:
504
            _xmltask = cmd.add_element('task')
505
            _xmltask.add_element('name', task_name)
506
            if comment:
507
                _xmltask.add_element('comment', comment)
508
        else:
509
            raise ValueError('create_report requires an id or name for a task')
510
511
        in_assets = kwargs.get('in_assets', '')
512
        if in_assets:
513
            cmd.add_element('in_assets', in_assets)
514
515
        cmd.append_xml_str(report_xml_string)
516
517
        return cmd.to_string()
518
519
    def create_role_command(self, name, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
520
        """Generates xml string for create role on gvmd."""
521
522
        if not name:
523
            raise ValueError('create_role requires a name element')
524
525
        cmd = XmlCommand('create_role')
526
        cmd.add_element('name', name)
527
528
        comment = kwargs.get('comment', '')
529
        if comment:
530
            cmd.add_element('comment', comment)
531
532
        copy = kwargs.get('copy', '')
533
        if copy:
534
            cmd.add_element('copy', copy)
535
536
        users = kwargs.get('users', '')
537
        if users:
538
            cmd.add_element('users', users)
539
540
        return cmd.to_string()
541
542
    def create_scanner_command(self, name, host, port, type, ca_pub,
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in type.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
best-practice introduced by
Too many arguments (8/5)
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
543
                               credential_id, kwargs):
544
        """Generates xml string for create scanner on gvmd."""
545
        if not name:
546
            raise ValueError('create_scanner requires a name element')
547
        if not host:
548
            raise ValueError('create_scanner requires a host element')
549
        if not port:
550
            raise ValueError('create_scanner requires a port element')
551
        if not type:
552
            raise ValueError('create_scanner requires a type element')
553
        if not ca_pub:
554
            raise ValueError('create_scanner requires a ca_pub element')
555
        if not credential_id:
556
            raise ValueError('create_scanner requires a credential_id element')
557
558
        cmd = XmlCommand('create_scanner')
559
        cmd.add_element('name', name)
560
        cmd.add_element('host', host)
561
        cmd.add_element('port', port)
562
        cmd.add_element('type', type)
563
        cmd.add_element('ca_pub', ca_pub)
564
        cmd.add_element('credential', attrs={'id': str(credential_id)})
565
566
        comment = kwargs.get('comment', '')
567
        if comment:
568
            cmd.add_element('comment', comment)
569
570
        copy = kwargs.get('copy', '')
571
        if copy:
572
            cmd.add_element('copy', copy)
573
574
        return cmd.to_string()
575
576
    def create_schedule_command(self, name, kwargs):
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
577
        """Generates xml string for create schedule on gvmd."""
578
        if not name:
579
            raise ValueError('create_schedule requires a name element')
580
581
        cmd = XmlCommand('create_schedule')
582
        cmd.add_element('name', name)
583
584
        comment = kwargs.get('comment', '')
585
        if comment:
586
            cmd.add_element('comment', comment)
587
588
        copy = kwargs.get('copy', '')
589
        if copy:
590
            cmd.add_element('copy', copy)
591
592
        first_time = kwargs.get('first_time', '')
593
        if first_time:
594
            first_time_minute = first_time['minute']
595
            first_time_hour = first_time['hour']
596
            first_time_day_of_month = first_time['day_of_month']
597
            first_time_month = first_time['month']
598
            first_time_year = first_time['year']
599
600
            _xmlftime = cmd.add_element('first_time')
601
            _xmlftime.add_element('minute', first_time_minute)
602
            _xmlftime.add_element('hour', str(first_time_hour))
603
            _xmlftime.add_element('day_of_month', str(first_time_day_of_month))
604
            _xmlftime.add_element('month', str(first_time_month))
605
            _xmlftime.add_element('year', str(first_time_year))
606
607
        duration = kwargs.get('duration', '')
608
        if len(duration) > 1:
609
            _xmlduration = cmd.add_element('duration', str(duration[0]))
610
            _xmlduration.add_element('unit', str(duration[1]))
611
612
        period = kwargs.get('period', '')
613
        if len(period) > 1:
614
            _xmlperiod = cmd.add_element('period', str(period[0]))
615
            _xmlperiod.add_element('unit', str(period[1]))
616
617
        timezone = kwargs.get('timezone', '')
618
        if timezone:
619
            cmd.add_element('timezone', str(timezone))
620
621
        return cmd.to_string()
622
623
    def create_tag_command(self, name, resource_id, resource_type, kwargs):
0 ignored issues
show
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
624
        """Generates xml string for create tag on gvmd."""
625
626
        cmd = XmlCommand('create_tag')
627
        cmd.add_element('name', name)
628
        _xmlresource = cmd.add_element('resource',
629
                                       attrs={'id': str(resource_id)})
630
        _xmlresource.add_element('type', resource_type)
631
632
        comment = kwargs.get('comment', '')
633
        if comment:
634
            cmd.add_element('comment', comment)
635
636
        copy = kwargs.get('copy', '')
637
        if copy:
638
            cmd.add_element('copy', copy)
639
640
        value = kwargs.get('value', '')
641
        if value:
642
            cmd.add_element('value', value)
643
644
        active = kwargs.get('active', '')
645
        if active:
646
            cmd.add_element('active', active)
647
648
        return cmd.to_string()
649
650
    def create_target_command(self, name, make_unique, kwargs):
0 ignored issues
show
Comprehensibility introduced by
This function exceeds the maximum number of variables (17/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
651
        """Generates xml string for create target on gvmd."""
652
        if not name:
653
            raise ValueError('create_target requires a name element')
654
655
        cmd = XmlCommand('create_target')
656
        _xmlname = cmd.add_element('name', name)
657
        if make_unique:
658
            _xmlname.add_element('make_unique', '1')
659
        else:
660
            _xmlname.add_element('make_unique', '0')
661
662
        if 'asset_hosts' in kwargs:
663
            hosts = kwargs.get('asset_hosts')
664
            filter = hosts['filter']
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in filter.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
665
            cmd.add_element('asset_hosts', attrs={'filter': str(filter)})
666
        elif 'hosts' in kwargs:
667
            hosts = kwargs.get('hosts')
668
            cmd.add_element('hosts', hosts)
669
        else:
670
            raise ValueError('create_target requires either a hosts or '
671
                             'an asset_hosts element')
672
673
        if 'comment' in kwargs:
674
            cmd.add_element('comment', kwargs.get('comment'))
675
676
        if 'copy' in kwargs:
677
            # NOTE: It seems that hosts/asset_hosts is silently ignored by the
678
            # server when copy is supplied. But for specification conformance
679
            # we raise the ValueError above and consider copy optional.
680
            cmd.add_element('copy', kwargs.get('copy'))
681
682
        if 'exclude_hosts' in kwargs:
683
            cmd.add_element('exclude_hosts', kwargs.get('exclude_hosts'))
684
685
        if 'ssh_credential' in kwargs:
686
            ssh_credential = kwargs.get('ssh_credential')
687
            if 'id' in ssh_credential:
688
                _xmlssh = cmd.add_element('ssh_credential', '',
689
                                          attrs={'id': ssh_credential['id']})
690
                if 'port' in ssh_credential:
691
                    _xmlssh.add_element('port', ssh_credential['port'])
692
            else:
693
                raise ValueError('ssh_credential requires an id attribute')
694
695
        if 'smb_credential' in kwargs:
696
            smb_credential = kwargs.get('smb_credential')
697
            if 'id' in smb_credential:
698
                cmd.add_element('smb_credential',
699
                                attrs={'id': smb_credential['id']})
700
            else:
701
                raise ValueError('smb_credential requires an id attribute')
702
703
        if 'esxi_credential' in kwargs:
704
            esxi_credential = kwargs.get('esxi_credential')
705
            if 'id' in esxi_credential:
706
                cmd.add_element('esxi_credential',
707
                                attrs={'id': esxi_credential['id']})
708
            else:
709
                raise ValueError('esxi_credential requires an id attribute')
710
711
        if 'snmp_credential' in kwargs:
712
            snmp_credential = kwargs.get('snmp_credential')
713
            if 'id' in snmp_credential:
714
                cmd.add_element('snmp_credential',
715
                                attrs={'id': snmp_credential['id']})
716
            else:
717
                raise ValueError('snmp_credential requires an id attribute')
718
719
        if 'alive_tests' in kwargs:
720
            # NOTE: As the alive_tests are referenced by their name and some
721
            # names contain ampersand ('&') characters it should be considered
722
            # replacing any characters special to XML in the variable with
723
            # their corresponding entities.
724
            cmd.add_element('alive_tests', kwargs.get('alive_tests'))
725
726
        if 'reverse_lookup_only' in kwargs:
727
            reverse_lookup_only = kwargs.get('reverse_lookup_only')
728
            if reverse_lookup_only:
729
                cmd.add_element('reverse_lookup_only', '1')
730
            else:
731
                cmd.add_element('reverse_lookup_only', '0')
732
733
        if 'reverse_lookup_unify' in kwargs:
734
            reverse_lookup_unify = kwargs.get('reverse_lookup_unify')
735
            if reverse_lookup_unify:
736
                cmd.add_element('reverse_lookup_unify', '1')
737
            else:
738
                cmd.add_element('reverse_lookup_unify', '0')
739
740
        if 'port_range' in kwargs:
741
            cmd.add_element('port_range', kwargs.get('port_range'))
742
743
        if 'port_list' in kwargs:
744
            port_list = kwargs.get('port_list')
745
            if 'id' in port_list:
746
                cmd.add_element('port_list',
747
                                attrs={'id': str(port_list['id'])})
748
            else:
749
                raise ValueError('port_list requires an id attribute')
750
751
        return cmd.to_string()
752
753
    def create_task_command(self, name, config_id, target_id, scanner_id,
0 ignored issues
show
best-practice introduced by
Too many arguments (7/5)
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
754
                            alert_ids=None, comment=''):
755
        """Generates xml string for create task on gvmd."""
756
757
        if alert_ids is None:
758
            alert_ids = []
759
        cmd = XmlCommand('create_task')
760
        cmd.add_element('name', name)
761
        cmd.add_element('comment', comment)
762
        cmd.add_element('config', attrs={'id': config_id})
763
        cmd.add_element('target', attrs={'id': target_id})
764
        cmd.add_element('scanner', attrs={'id': scanner_id})
765
766
        #if given the alert_id is wrapped and integrated suitably as xml
767
        if len(alert_ids) > 0:
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
768
            if isinstance(alert_ids, str):
769
                #if a single id is given as a string wrap it into a list
770
                alert_ids = [alert_ids]
771
            if isinstance(alert_ids, list):
772
                #parse all given alert id's
773
                for alert in alert_ids:
774
                    cmd.add_element('alert', attrs={'id': str(alert)})
775
776
        return cmd.to_string()
777
778
    def create_user_command(self, name, password, copy='', hosts_allow='0',
0 ignored issues
show
best-practice introduced by
Too many arguments (9/5)
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
779
                            ifaces_allow='0', role_ids=(), hosts=None,
780
                            ifaces=None):
781
        """Generates xml string for create user on gvmd."""
782
        cmd = XmlCommand('create_user')
783
        cmd.add_element('name', name)
784
785
        if copy:
786
            cmd.add_element('copy', copy)
787
788
        if password:
789
            cmd.add_element('password', password)
790
791
        if hosts is not None:
792
            cmd.add_element('hosts', hosts, attrs={'allow': str(hosts_allow)})
793
794
        if ifaces is not None:
795
            cmd.add_element('ifaces', ifaces,
796
                            attrs={'allow': str(ifaces_allow)})
797
798
        if len(role_ids) > 0:
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
799
            for role in role_ids:
800
                cmd.add_element('role', attrs={'allow': str(role)})
801
802
        return cmd.to_string()
803
804
    def modify_agent_command(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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
805
        if not agent_id:
806
            raise ValueError('modify_agent requires an agent_id element')
807
808
        xmlRoot = etree.Element('modify_agent', agent_id=str(agent_id))
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
809
        if name:
810
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
811
            _xmlName.text = name
812
813
        if comment:
814
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
815
            _xmlComment.text = comment
816
817
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
818
819
    def modify_alert_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (21/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
820
        if not alert_id:
821
            raise ValueError('modify_alert requires an agent_id element')
822
823
        xmlRoot = etree.Element('modify_alert', alert_id=str(alert_id))
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
824
825
        name = kwargs.get('name', '')
826
        if name:
827
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
828
            _xmlName.text = name
829
830
        comment = kwargs.get('comment', '')
831
        if comment:
832
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
833
            _xmlComment.text = comment
834
835
        filter_id = kwargs.get('filter_id', '')
836
        if filter_id:
837
            _xmlFilter = etree.SubElement(xmlRoot, 'filter', id=filter_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFilter 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
838
839
        event = kwargs.get('event', '')
840
        if len(event) > 1:
841
            _xmlEvent = etree.SubElement(xmlRoot, 'event')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlEvent 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
842
            _xmlEvent.text = event[0]
843
            for value, key in event[1].items():
844
                _xmlData = etree.SubElement(_xmlEvent, 'data')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlData 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
845
                _xmlData.text = value
846
                _xmlDName = etree.SubElement(_xmlData, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlDName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
847
                _xmlDName.text = key
848
849
        condition = kwargs.get('condition', '')
850
        if len(condition) > 1:
851
            _xmlCond = etree.SubElement(xmlRoot, 'condition')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCond 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
852
            _xmlCond.text = condition[0]
853
            for value, key in condition[1].items():
854
                _xmlData = etree.SubElement(_xmlCond, 'data')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlData 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
855
                _xmlData.text = value
856
                _xmlDName = etree.SubElement(_xmlData, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlDName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
857
                _xmlDName.text = key
858
859
        method = kwargs.get('method', '')
860
        if len(method) > 1:
861
            _xmlMethod = etree.SubElement(xmlRoot, 'method')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlMethod 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
862
            _xmlMethod.text = method[0]
863
            for value, key in method[1].items():
864
                _xmlData = etree.SubElement(_xmlMethod, 'data')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlData 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
865
                _xmlData.text = value
866
                _xmlDName = etree.SubElement(_xmlData, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlDName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
867
                _xmlDName.text = key
868
869
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
870
871
    def modify_auth_command(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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
872
        if not group_name:
873
            raise ValueError('modify_auth requires a group element '
874
                             'with a name attribute')
875
        if not auth_conf_settings:
876
            raise ValueError('modify_auth requires '
877
                             'an auth_conf_settings element')
878
879
        xmlRoot = etree.Element('modify_auth')
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
880
        _xmlGroup = etree.SubElement(xmlRoot, 'group', name=str(group_name))
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlGroup 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
881
882
        for key, value in auth_conf_settings.items():
883
            _xmlAuthConf = etree.SubElement(_xmlGroup, 'auth_conf_setting')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAuthConf 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
884
            _xmlKey = etree.SubElement(_xmlAuthConf, 'key')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlKey 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
885
            _xmlKey.text = key
886
            _xmlValue = etree.SubElement(_xmlAuthConf, 'value')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlValue 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
887
            _xmlValue.text = value
888
889
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
890
891
    def modify_config_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (21/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
892
        if selection not in ('nvt_pref', 'sca_pref',
893
                             'family_selection', 'nvt_selection'):
894
            raise ValueError('selection must be one of nvt_pref, sca_pref, '
895
                             'family_selection or nvt_selection')
896
        config_id = kwargs.get('config_id')
897
898
        xmlRoot = etree.Element('modify_config', config_id=str(config_id))
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
899
900
        if selection in 'nvt_pref':
901
            nvt_oid = kwargs.get('nvt_oid')
902
            name = kwargs.get('name')
903
            value = kwargs.get('value')
904
            _xmlPref = etree.SubElement(xmlRoot, 'preference')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPref 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
905
            _xmlNvt = etree.SubElement(_xmlPref, 'nvt', oid=nvt_oid)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlNvt 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
906
            _xmlName = etree.SubElement(_xmlPref, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
907
            _xmlName.text = name
908
            _xmlValue = etree.SubElement(_xmlPref, 'value')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlValue 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
909
            _xmlValue.text = value
910
911
        elif selection in 'nvt_selection':
912
            nvt_oid = kwargs.get('nvt_oid')
913
            family = kwargs.get('family')
914
            _xmlNvtSel = etree.SubElement(xmlRoot, 'nvt_selection')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlNvtSel 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
915
            _xmlFamily = etree.SubElement(_xmlNvtSel, 'family')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFamily 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
916
            _xmlFamily.text = family
917
918
            if isinstance(nvt_oid, list):
919
                for nvt in nvt_oid:
920
                    _xmlNvt = etree.SubElement(_xmlNvtSel, 'nvt', oid=nvt)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlNvt 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
921
            else:
922
                _xmlNvt = etree.SubElement(_xmlNvtSel, 'nvt', oid=nvt)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable nvt does not seem to be defined.
Loading history...
Coding Style Naming introduced by
The name _xmlNvt 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
923
924
        elif selection in 'family_selection':
925
            family = kwargs.get('family')
926
            _xmlFamSel = etree.SubElement(xmlRoot, 'family_selection')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFamSel 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
927
            _xmlGrow = etree.SubElement(_xmlFamSel, 'growing')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlGrow 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
928
            _xmlGrow.text = '1'
929
            _xmlFamily = etree.SubElement(_xmlFamSel, 'family')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFamily 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
930
            _xmlName = etree.SubElement(_xmlFamily, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
931
            _xmlName.text = family
932
            _xmlAll = etree.SubElement(_xmlFamily, 'all')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAll 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
933
            _xmlAll.text = '1'
934
            _xmlGrowI = etree.SubElement(_xmlFamily, 'growing')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlGrowI 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
935
            _xmlGrowI.text = '1'
936
        else:
937
            raise NotImplementedError
938
939
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
940
941
    def modify_credential_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (35/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
942
        if not credential_id:
943
            raise ValueError('modify_credential requires '
944
                             'a credential_id attribute')
945
946
        xmlRoot = etree.Element('modify_credential',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
947
                                credential_id=credential_id)
948
949
        comment = kwargs.get('comment', '')
950
        if comment:
951
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
952
            _xmlComment.text = comment
953
954
        name = kwargs.get('name', '')
955
        if name:
956
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
957
            _xmlName.text = name
958
959
        allow_insecure = kwargs.get('allow_insecure', '')
960
        if allow_insecure:
961
            _xmlAllowinsecure = etree.SubElement(xmlRoot, 'allow_insecure')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAllowinsecure 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
962
            _xmlAllowinsecure.text = allow_insecure
963
964
        certificate = kwargs.get('certificate', '')
965
        if certificate:
966
            _xmlCertificate = etree.SubElement(xmlRoot, 'certificate')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCertificate 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
967
            _xmlCertificate.text = certificate
968
969
        key = kwargs.get('key', '')
970
        if key:
971
            phrase = key['phrase']
972
            private = key['private']
973
            if not phrase:
974
                raise ValueError('modify_credential requires a phrase element')
975
            if not private:
976
                raise ValueError('modify_credential requires '
977
                                 'a private element')
978
            _xmlKey = etree.SubElement(xmlRoot, 'key')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlKey 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
979
            _xmlKeyphrase = etree.SubElement(_xmlKey, 'phrase')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlKeyphrase 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
980
            _xmlKeyphrase.text = phrase
981
            _xmlKeyprivate = etree.SubElement(_xmlKey, 'private')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlKeyprivate 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
982
            _xmlKeyprivate.text = private
983
984
        login = kwargs.get('login', '')
985
        if login:
986
            _xmlLogin = etree.SubElement(xmlRoot, 'login')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlLogin 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
987
            _xmlLogin.text = login
988
989
        password = kwargs.get('password', '')
990
        if password:
991
            _xmlPass = etree.SubElement(xmlRoot, 'password')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPass 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
992
            _xmlPass.text = password
993
994
        auth_algorithm = kwargs.get('auth_algorithm', '')
995
        if auth_algorithm:
996
            if auth_algorithm not in ('md5', 'sha1'):
997
                raise ValueError('modify_credential requires auth_algorithm '
998
                                 'to be either md5 or sha1')
999
            _xmlAuthalg = etree.SubElement(xmlRoot, 'auth_algorithm')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAuthalg 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1000
            _xmlAuthalg.text = auth_algorithm
1001
1002
        community = kwargs.get('community', '')
1003
        if community:
1004
            _xmlCommunity = etree.SubElement(xmlRoot, 'community')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCommunity 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1005
            _xmlCommunity.text = community
1006
1007
        privacy = kwargs.get('privacy', '')
1008
        if privacy:
1009
            algorithm = privacy.algorithm
1010
            if algorithm not in ('aes', 'des'):
1011
                raise ValueError('modify_credential requires algorithm '
1012
                                 'to be either aes or des')
1013
            p_password = privacy.password
1014
            _xmlPrivacy = etree.SubElement(xmlRoot, 'privacy')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPrivacy 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1015
            _xmlAlgorithm = etree.SubElement(_xmlPrivacy, 'algorithm')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAlgorithm 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1016
            _xmlAlgorithm.text = algorithm
1017
            _xmlPpass = etree.SubElement(_xmlPrivacy, 'password')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPpass 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1018
            _xmlPpass.text = p_password
1019
1020
        cred_type = kwargs.get('type', '')
1021
        if cred_type:
1022
            if cred_type not in ('cc', 'snmp', 'up', 'usk'):
1023
                raise ValueError('modify_credential requires type '
1024
                                 'to be either cc, snmp, up or usk')
1025
            _xmlCredtype = etree.SubElement(xmlRoot, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCredtype 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1026
            _xmlCredtype.text = cred_type
1027
1028
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1029
1030
    def modify_filter_command(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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1031
        if not filter_id:
1032
            raise ValueError('modify_filter requires a filter_id attribute')
1033
1034
        xmlRoot = etree.Element('modify_filter', filter_id=filter_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1035
1036
        comment = kwargs.get('comment', '')
1037
        if comment:
1038
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1039
            _xmlComment.text = comment
1040
1041
        name = kwargs.get('name', '')
1042
        if name:
1043
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1044
            _xmlName.text = name
1045
1046
        copy = kwargs.get('copy', '')
1047
        if copy:
1048
            _xmlCopy = etree.SubElement(xmlRoot, 'copy')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCopy 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1049
            _xmlCopy.text = copy
1050
1051
        term = kwargs.get('term', '')
1052
        if term:
1053
            _xmlTerm = etree.SubElement(xmlRoot, 'term')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlTerm 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1054
            _xmlTerm.text = term
1055
1056
        filter_type = kwargs.get('type', '')
1057
        if filter_type:
1058
            if filter_type not in ('cc', 'snmp', 'up', 'usk'):
1059
                raise ValueError('modify_filter requires type '
1060
                                 'to be either cc, snmp, up or usk')
1061
            _xmlFiltertype = etree.SubElement(xmlRoot, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFiltertype 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1062
            _xmlFiltertype.text = filter_type
1063
1064
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1065
1066 View Code Duplication
    def modify_group_command(self, group_id, kwargs):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1067
        if not group_id:
1068
            raise ValueError('modify_group requires a group_id attribute')
1069
1070
        xmlRoot = etree.Element('modify_group', group_id=group_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1071
1072
        comment = kwargs.get('comment', '')
1073
        if comment:
1074
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1075
            _xmlComment.text = comment
1076
1077
        name = kwargs.get('name', '')
1078
        if name:
1079
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1080
            _xmlName.text = name
1081
1082
        users = kwargs.get('users', '')
1083
        if users:
1084
            _xmlUser = etree.SubElement(xmlRoot, 'users')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlUser 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1085
            _xmlUser.text = users
1086
1087
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1088
1089
    def modify_note_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (21/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1090
        if not note_id:
1091
            raise ValueError('modify_note requires a note_id attribute')
1092
        if not text:
1093
            raise ValueError('modify_note requires a text element')
1094
1095
        xmlRoot = etree.Element('modify_note', note_id=note_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1096
        _xmlText = etree.SubElement(xmlRoot, 'text')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlText 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1097
        _xmlText.text = text
1098
1099
        active = kwargs.get('active', '')
1100
        if active:
1101
            _xmlActive = etree.SubElement(xmlRoot, 'active')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlActive 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1102
            _xmlActive.text = active
1103
1104
        hosts = kwargs.get('hosts', '')
1105
        if hosts:
1106
            _xmlHosts = etree.SubElement(xmlRoot, 'hosts')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHosts 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1107
            _xmlHosts.text = hosts
1108
1109
        port = kwargs.get('port', '')
1110
        if port:
1111
            _xmlPort = etree.SubElement(xmlRoot, 'port')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPort 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1112
            _xmlPort.text = port
1113
1114
        result_id = kwargs.get('result_id', '')
1115
        if result_id:
1116
            _xmlResultid = etree.SubElement(xmlRoot, 'result', id=result_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlResultid 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1117
1118
        severity = kwargs.get('severity', '')
1119
        if severity:
1120
            _xmlSeverity = etree.SubElement(xmlRoot, 'severity')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSeverity 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1121
            _xmlSeverity.text = severity
1122
1123
        task_id = kwargs.get('task_id', '')
1124
        if task_id:
1125
            _xmlTaskid = etree.SubElement(xmlRoot, 'task', id=task_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlTaskid 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1126
1127
        threat = kwargs.get('threat', '')
1128
        if threat:
1129
            _xmlThreat = etree.SubElement(xmlRoot, 'threat')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlThreat 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1130
            _xmlThreat.text = threat
1131
1132
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1133
1134
    def modify_override_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (25/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1135
        xmlRoot = etree.Element('modify_override',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1136
                                override_id=override_id)
1137
        _xmlText = etree.SubElement(xmlRoot, 'text')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlText 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1138
        _xmlText.text = text
1139
1140
        active = kwargs.get('active', '')
1141
        if active:
1142
            _xmlActive = etree.SubElement(xmlRoot, 'active')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlActive 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1143
            _xmlActive.text = active
1144
1145
        hosts = kwargs.get('hosts', '')
1146
        if hosts:
1147
            _xmlHosts = etree.SubElement(xmlRoot, 'hosts')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHosts 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1148
            _xmlHosts.text = hosts
1149
1150
        port = kwargs.get('port', '')
1151
        if port:
1152
            _xmlPort = etree.SubElement(xmlRoot, 'port')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPort 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1153
            _xmlPort.text = port
1154
1155
        result_id = kwargs.get('result_id', '')
1156
        if result_id:
1157
            _xmlResultid = etree.SubElement(xmlRoot, 'result', id=result_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlResultid 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1158
1159
        severity = kwargs.get('severity', '')
1160
        if severity:
1161
            _xmlSeverity = etree.SubElement(xmlRoot, 'severity')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSeverity 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1162
            _xmlSeverity.text = severity
1163
1164
        new_severity = kwargs.get('new_severity', '')
1165
        if new_severity:
1166
            _xmlNSeverity = etree.SubElement(xmlRoot, 'new_severity')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlNSeverity 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1167
            _xmlNSeverity.text = new_severity
1168
1169
        task_id = kwargs.get('task_id', '')
1170
        if task_id:
1171
            _xmlTaskid = etree.SubElement(xmlRoot, 'task', id=task_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlTaskid 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1172
1173
        threat = kwargs.get('threat', '')
1174
        if threat:
1175
            _xmlThreat = etree.SubElement(xmlRoot, 'threat')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlThreat 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1176
            _xmlThreat.text = threat
1177
1178
        new_threat = kwargs.get('new_threat', '')
1179
        if new_threat:
1180
            _xmlNThreat = etree.SubElement(xmlRoot, 'new_threat')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlNThreat 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1181
            _xmlNThreat.text = new_threat
1182
1183
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1184
1185
    def modify_permission_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1186
        if not permission_id:
1187
            raise ValueError('modify_permission requires '
1188
                             'a permission_id element')
1189
1190
        xmlRoot = etree.Element('modify_permission',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1191
                                permission_id=permission_id)
1192
1193
        comment = kwargs.get('comment', '')
1194
        if comment:
1195
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1196
            _xmlComment.text = comment
1197
1198
        name = kwargs.get('name', '')
1199
        if name:
1200
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1201
            _xmlName.text = name
1202
1203
        resource = kwargs.get('resource', '')
1204
        if resource:
1205
            resource_id = resource['id']
1206
            resource_type = resource['type']
1207
            _xmlResource = etree.SubElement(xmlRoot, 'resource',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlResource 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1208
                                            id=resource_id)
1209
            _xmlRType = etree.SubElement(_xmlResource, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlRType 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1210
            _xmlRType.text = resource_type
1211
1212
        subject = kwargs.get('subject', '')
1213
        if subject:
1214
            subject_id = subject['id']
1215
            subject_type = subject['type']
1216
            _xmlSubject = etree.SubElement(xmlRoot, 'subject', id=subject_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSubject 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1217
            _xmlType = etree.SubElement(_xmlSubject, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlType 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1218
            _xmlType.text = subject_type
1219
1220
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1221
1222
    def modify_port_list_command(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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1223
        if not port_list_id:
1224
            raise ValueError('modify_port_list requires '
1225
                             'a port_list_id attribute')
1226
        xmlRoot = etree.Element('modify_port_list',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1227
                                port_list_id=port_list_id)
1228
1229
        comment = kwargs.get('comment', '')
1230
        if comment:
1231
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1232
            _xmlComment.text = comment
1233
1234
        name = kwargs.get('name', '')
1235
        if name:
1236
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1237
            _xmlName.text = name
1238
1239
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1240
1241
    def modify_report_format_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (17/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1242
        if len(kwargs) < 1:
1243
            raise Exception('modify_report_format: Missing parameter')
1244
1245
        xmlRoot = etree.Element('modify_report_format',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1246
                                report_format_id=report_format_id)
1247
1248
        active = kwargs.get('active', '')
1249
        if active:
1250
            _xmlActive = etree.SubElement(xmlRoot, 'active')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlActive 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1251
            _xmlActive.text = active
1252
1253
        name = kwargs.get('name', '')
1254
        if name:
1255
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1256
            _xmlName.text = name
1257
1258
            summary = kwargs.get('summary', '')
1259
        if summary:
0 ignored issues
show
introduced by
The variable summary does not seem to be defined in case name on line 1254 is False. Are you sure this can never be the case?
Loading history...
1260
            _xmlSummary = etree.SubElement(xmlRoot, 'summary')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSummary 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1261
            _xmlSummary.text = summary
1262
1263
        param = kwargs.get('param', '')
1264
        if param:
1265
            p_name = param[0]
1266
            p_value = param[1]
1267
            _xmlParam = etree.SubElement(xmlRoot, 'param')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlParam 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1268
            _xmlPname = etree.SubElement(_xmlParam, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPname 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1269
            _xmlPname.text = p_name
1270
            _xmlValue = etree.SubElement(_xmlParam, 'value')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlValue 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1271
            _xmlValue.text = p_value
1272
1273
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1274
1275 View Code Duplication
    def modify_role_command(self, role_id, kwargs):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1276
        if not role_id:
1277
            raise ValueError('modify_role requires a role_id element')
1278
1279
        xmlRoot = etree.Element('modify_role',
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1280
                                role_id=role_id)
1281
1282
        comment = kwargs.get('comment', '')
1283
        if comment:
1284
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1285
            _xmlComment.text = comment
1286
1287
        name = kwargs.get('name', '')
1288
        if name:
1289
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1290
            _xmlName.text = name
1291
1292
        users = kwargs.get('users', '')
1293
        if users:
1294
            _xmlUser = etree.SubElement(xmlRoot, 'users')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlUser 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1295
            _xmlUser.text = users
1296
1297
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1298
1299
    def modify_scanner_command(self, scanner_id, host, port, scanner_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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (19/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1300
                               kwargs):
1301
        if not scanner_id:
1302
            raise ValueError('modify_scanner requires a scanner_id element')
1303
        if not host:
1304
            raise ValueError('modify_scanner requires a host element')
1305
        if not port:
1306
            raise ValueError('modify_scanner requires a port element')
1307
        if not scanner_type:
1308
            raise ValueError('modify_scanner requires a type element')
1309
1310
        xmlRoot = etree.Element('modify_scanner', scanner_id=scanner_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1311
        _xmlHost = etree.SubElement(xmlRoot, 'host')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHost 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1312
        _xmlHost.text = host
1313
        _xmlPort = etree.SubElement(xmlRoot, 'port')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPort 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1314
        _xmlPort.text = port
1315
        _xmlType = etree.SubElement(xmlRoot, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlType 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1316
        _xmlType.text = scanner_type
1317
1318
        comment = kwargs.get('comment', '')
1319
        if comment:
1320
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1321
            _xmlComment.text = comment
1322
1323
        name = kwargs.get('name', '')
1324
        if name:
1325
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1326
            _xmlName.text = name
1327
1328
        ca_pub = kwargs.get('ca_pub', '')
1329
        if ca_pub:
1330
            _xmlCAPub = etree.SubElement(xmlRoot, 'ca_pub')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCAPub 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1331
            _xmlCAPub.text = ca_pub
1332
1333
        credential_id = kwargs.get('credential_id', '')
1334
        if credential_id:
1335
            _xmlCred = etree.SubElement(xmlRoot, 'credential',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCred 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1336
                                        id=str(credential_id))
1337
1338
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1339
1340
    def modify_schedule_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (29/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1341
        if not schedule_id:
1342
            raise ValueError('modify_schedule requires a schedule_id element')
1343
1344
        xmlRoot = etree.Element('modify_schedule', schedule_id=schedule_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1345
        comment = kwargs.get('comment', '')
1346
        if comment:
1347
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1348
            _xmlComment.text = comment
1349
1350
        name = kwargs.get('name', '')
1351
        if name:
1352
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1353
            _xmlName.text = name
1354
1355
        first_time = kwargs.get('first_time', '')
1356
        if first_time:
1357
            first_time_minute = first_time['minute']
1358
            first_time_hour = first_time['hour']
1359
            first_time_day_of_month = first_time['day_of_month']
1360
            first_time_month = first_time['month']
1361
            first_time_year = first_time['year']
1362
1363
            _xmlFtime = etree.SubElement(xmlRoot, 'first_time')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFtime 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1364
            _xmlMinute = etree.SubElement(_xmlFtime, 'minute')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlMinute 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1365
            _xmlMinute.text = str(first_time_minute)
1366
            _xmlHour = etree.SubElement(_xmlFtime, 'hour')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHour 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1367
            _xmlHour.text = str(first_time_hour)
1368
            _xmlDay = etree.SubElement(_xmlFtime, 'day_of_month')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlDay 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1369
            _xmlDay.text = str(first_time_day_of_month)
1370
            _xmlMonth = etree.SubElement(_xmlFtime, 'month')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlMonth 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1371
            _xmlMonth.text = str(first_time_month)
1372
            _xmlYear = etree.SubElement(_xmlFtime, 'year')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlYear 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1373
            _xmlYear.text = str(first_time_year)
1374
1375
        duration = kwargs.get('duration', '')
1376
        if len(duration) > 1:
1377
            _xmlDuration = etree.SubElement(xmlRoot, 'duration')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlDuration 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1378
            _xmlDuration.text = str(duration[0])
1379
            _xmlUnit = etree.SubElement(_xmlDuration, 'unit')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlUnit 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1380
            _xmlUnit.text = str(duration[1])
1381
1382
        period = kwargs.get('period', '')
1383
        if len(period) > 1:
1384
            _xmlPeriod = etree.SubElement(xmlRoot, 'period')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPeriod 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1385
            _xmlPeriod.text = str(period[0])
1386
            _xmlPUnit = etree.SubElement(_xmlPeriod, 'unit')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPUnit 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1387
            _xmlPUnit.text = str(period[1])
1388
1389
        timezone = kwargs.get('timezone', '')
1390
        if timezone:
1391
            _xmlTimezone = etree.SubElement(xmlRoot, 'timezone')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlTimezone 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1392
            _xmlTimezone.text = str(timezone)
1393
1394
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1395
1396
    def modify_tag_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (18/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1397
        if not tag_id:
1398
            raise ValueError('modify_tag requires a tag_id element')
1399
1400
        xmlRoot = etree.Element('modify_tag', tag_id=str(tag_id))
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1401
1402
        comment = kwargs.get('comment', '')
1403
        if comment:
1404
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1405
            _xmlComment.text = comment
1406
1407
        name = kwargs.get('name', '')
1408
        if name:
1409
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1410
            _xmlName.text = name
1411
1412
        value = kwargs.get('value', '')
1413
        if value:
1414
            _xmlValue = etree.SubElement(xmlRoot, 'value')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlValue 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1415
            _xmlValue.text = value
1416
1417
        active = kwargs.get('active', '')
1418
        if active:
1419
            _xmlActive = etree.SubElement(xmlRoot, 'active')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlActive 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1420
            _xmlActive.text = value
1421
1422
        resource = kwargs.get('resource', '')
1423
        if resource:
1424
            resource_id = resource['id']
1425
            resource_type = resource['type']
1426
            _xmlResource = etree.SubElement(xmlRoot, 'resource',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlResource 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1427
                                            resource_id=resource_id)
1428
            _xmlRType = etree.SubElement(_xmlResource, 'type')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlRType 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1429
            _xmlRType.text = resource_type
1430
1431
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1432
1433
    def modify_target_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (25/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1434
        if not target_id:
1435
            raise ValueError('modify_target requires a target_id element')
1436
1437
        xmlRoot = etree.Element('modify_target', target_id=target_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1438
1439
        comment = kwargs.get('comment', '')
1440
        if comment:
1441
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1442
            _xmlComment.text = comment
1443
1444
        name = kwargs.get('name', '')
1445
        if name:
1446
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1447
            _xmlName.text = name
1448
1449
        hosts = kwargs.get('hosts', '')
1450
        if hosts:
1451
            _xmlHosts = etree.SubElement(xmlRoot, 'hosts')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHosts 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1452
            _xmlHosts.text = hosts
1453
1454
        copy = kwargs.get('copy', '')
1455
        if copy:
1456
            _xmlCopy = etree.SubElement(xmlRoot, 'copy')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlCopy 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1457
            _xmlCopy.text = kwargs.get('copy')
1458
1459
        exclude_hosts = kwargs.get('exclude_hosts', '')
1460
        if exclude_hosts:
1461
            _xmlExHosts = etree.SubElement(xmlRoot, 'exclude_hosts')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlExHosts 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1462
            _xmlExHosts.text = kwargs.get('exclude_hosts')
1463
1464
        alive_tests = kwargs.get('alive_tests', '')
1465
        if alive_tests:
1466
            _xmlAlive = etree.SubElement(xmlRoot, 'alive_tests')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAlive 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1467
            _xmlAlive.text = kwargs.get('alive_tests')
1468
1469
        reverse_lookup_only = kwargs.get('reverse_lookup_only', '')
1470
        if reverse_lookup_only:
1471
            _xmlLookup = etree.SubElement(xmlRoot, 'reverse_lookup_only')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlLookup 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1472
            _xmlLookup.text = reverse_lookup_only
1473
1474
        reverse_lookup_unify = kwargs.get('reverse_lookup_unify', '')
1475
        if reverse_lookup_unify:
1476
            _xmlLookupU = etree.SubElement(xmlRoot, 'reverse_lookup_unify')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlLookupU 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1477
            _xmlLookupU.text = reverse_lookup_unify
1478
1479
        port_range = kwargs.get('port_range', '')
1480
        if port_range:
1481
            _xmlPortR = etree.SubElement(xmlRoot, 'port_range')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPortR 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1482
            _xmlPortR.text = kwargs.get('port_range')
1483
1484
        port_list = kwargs.get('port_list', '')
1485
        if port_list:
1486
            _xmlPortL = etree.SubElement(xmlRoot, 'port_list',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPortL 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1487
                                         id=str(port_list))
1488
1489
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1490
1491
    def modify_task_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (33/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1492
        if not task_id:
1493
            raise ValueError('modify_task requires a task_id element')
1494
1495
        xmlRoot = etree.Element('modify_task', task_id=task_id)
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1496
1497
        name = kwargs.get('name', '')
1498
        if name:
1499
            _xmlName = etree.SubElement(xmlRoot, 'name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1500
            _xmlName.text = name
1501
1502
        comment = kwargs.get('comment', '')
1503
        if comment:
1504
            _xmlComment = etree.SubElement(xmlRoot, 'comment')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlComment 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1505
            _xmlComment.text = comment
1506
1507
        target_id = kwargs.get('target_id', '')
1508
        if target_id:
1509
            _xmlTarget = etree.SubElement(xmlRoot, 'target', id=target_id)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlTarget 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1510
1511
        scanner = kwargs.get('scanner', '')
1512
        if scanner:
1513
            _xmlScanner = etree.SubElement(xmlRoot, 'scanner', id=scanner)
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlScanner 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1514
1515
        schedule_periods = kwargs.get('schedule_periods', '')
1516
        if schedule_periods:
1517
            _xmlPeriod = etree.SubElement(xmlRoot, 'schedule_periods')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPeriod 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1518
            _xmlPeriod.text = str(schedule_periods)
1519
1520
        schedule = kwargs.get('schedule', '')
1521
        if schedule:
1522
            _xmlSched = etree.SubElement(xmlRoot, 'schedule', id=str(schedule))
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSched 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1523
1524
        alert = kwargs.get('alert', '')
1525
        if alert:
1526
            _xmlAlert = etree.SubElement(xmlRoot, 'alert', id=str(alert))
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlAlert 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1527
1528
        observers = kwargs.get('observers', '')
1529
        if observers:
1530
            _xmlObserver = etree.SubElement(xmlRoot, 'observers')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlObserver 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1531
            _xmlObserver.text = str(observers)
1532
1533
        preferences = kwargs.get('preferences', '')
1534
        if preferences:
1535
            _xmlPrefs = etree.SubElement(xmlRoot, 'preferences')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPrefs 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1536
            for n in range(len(preferences["scanner_name"])):
0 ignored issues
show
Coding Style Naming introduced by
The name n 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...
1537
                preferences_scanner_name = preferences["scanner_name"][n]
1538
                preferences_value = preferences["value"][n]
1539
                _xmlPref = etree.SubElement(_xmlPrefs, 'preference')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPref 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1540
                _xmlScan = etree.SubElement(_xmlPref, 'scanner_name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlScan 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1541
                _xmlScan.text = preferences_scanner_name
1542
                _xmlVal = etree.SubElement(_xmlPref, 'value')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlVal 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1543
                _xmlVal.text = preferences_value
1544
1545
        file = kwargs.get('file', '')
1546
        if file:
1547
            file_name = file['name']
1548
            file_action = file['action']
1549
            if file_action != "update" and file_action != "remove":
1550
                raise ValueError('action can only be "update" or "remove"!')
1551
            _xmlFile = etree.SubElement(xmlRoot, 'file', name=file_name,
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlFile 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1552
                                        action=file_action)
1553
1554
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1555
1556
    def modify_user_command(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...
Comprehensibility introduced by
This function exceeds the maximum number of variables (21/15).
Loading history...
Coding Style introduced by
This method could be written as a function/class method.

If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example

class Foo:
    def some_method(self, x, y):
        return x + y;

could be written as

class Foo:
    @classmethod
    def some_method(cls, x, y):
        return x + y;
Loading history...
1557
        user_id = kwargs.get('user_id', '')
1558
        name = kwargs.get('name', '')
1559
1560
        if not user_id and not name:
1561
            raise ValueError('modify_user requires '
1562
                             'either a user_id or a name element')
1563
1564
        xmlRoot = etree.Element('modify_user', user_id=str(user_id))
0 ignored issues
show
Coding Style Naming introduced by
The name xmlRoot 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named Element.

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...
1565
1566
        new_name = kwargs.get('new_name', '')
1567
        if new_name:
1568
            _xmlName = etree.SubElement(xmlRoot, 'new_name')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlName 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1569
            _xmlName.text = new_name
1570
1571
        password = kwargs.get('password', '')
1572
        if password:
1573
            _xmlPass = etree.SubElement(xmlRoot, 'password')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlPass 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1574
            _xmlPass.text = password
1575
1576
        role_ids = kwargs.get('role_ids', '')
1577
        if len(role_ids) > 0:
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
1578
            for role in role_ids:
1579
                _xmlRole = etree.SubElement(xmlRoot, 'role',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlRole 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1580
                                            id=str(role))
1581
        hosts = kwargs.get('hosts', '')
1582
        hosts_allow = kwargs.get('hosts_allow', '')
1583
        if hosts or hosts_allow:
1584
            _xmlHosts = etree.SubElement(xmlRoot, 'hosts',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlHosts 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1585
                                         allow=str(hosts_allow))
1586
            _xmlHosts.text = hosts
1587
1588
        ifaces = kwargs.get('ifaces', '')
1589
        ifaces_allow = kwargs.get('ifaces_allow', '')
1590
        if ifaces or ifaces_allow:
1591
            _xmlIFaces = etree.SubElement(xmlRoot, 'ifaces',
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlIFaces 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1592
                                          allow=str(ifaces_allow))
1593
            _xmlIFaces.text = ifaces
1594
1595
        sources = kwargs.get('sources', '')
1596
        if sources:
1597
            _xmlSource = etree.SubElement(xmlRoot, 'sources')
0 ignored issues
show
Coding Style Naming introduced by
The name _xmlSource 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...
Bug introduced by
The Module lxml.etree does not seem to have a member named SubElement.

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...
1598
            _xmlSource.text = sources
1599
1600
        return etree.tostring(xmlRoot).decode('utf-8')
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named tostring.

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...
1601