@@ 264-284 (lines=21) @@ | ||
261 | ||
262 | return cmd.to_string() |
|
263 | ||
264 | def modify_role_command(self, role_id, kwargs): |
|
265 | """Generates xml string for modify role on gvmd.""" |
|
266 | if not role_id: |
|
267 | raise ValueError('modify_role requires a role_id element') |
|
268 | ||
269 | cmd = XmlCommand('modify_role') |
|
270 | cmd.set_attribute('role_id', role_id) |
|
271 | ||
272 | comment = kwargs.get('comment', '') |
|
273 | if comment: |
|
274 | cmd.add_element('comment', comment) |
|
275 | ||
276 | name = kwargs.get('name', '') |
|
277 | if name: |
|
278 | cmd.add_element('name', name) |
|
279 | ||
280 | users = kwargs.get('users', '') |
|
281 | if users: |
|
282 | cmd.add_element('users', users) |
|
283 | ||
284 | return cmd.to_string() |
|
285 | ||
286 | def modify_scanner_command(self, scanner_id, host, port, scanner_type, |
|
287 | kwargs): |
|
@@ 68-88 (lines=21) @@ | ||
65 | """Factory to create gmp - Greenbone Management Protocol - commands |
|
66 | """ |
|
67 | ||
68 | def modify_group_command(self, group_id, kwargs): |
|
69 | """Generates xml string for modify group on gvmd.""" |
|
70 | if not group_id: |
|
71 | raise ValueError('modify_group requires a group_id attribute') |
|
72 | ||
73 | cmd = XmlCommand('modify_group') |
|
74 | cmd.set_attribute('group_id', group_id) |
|
75 | ||
76 | comment = kwargs.get('comment', '') |
|
77 | if comment: |
|
78 | cmd.add_element('comment', comment) |
|
79 | ||
80 | name = kwargs.get('name', '') |
|
81 | if name: |
|
82 | cmd.add_element('name', name) |
|
83 | ||
84 | users = kwargs.get('users', '') |
|
85 | if users: |
|
86 | cmd.add_element('users', users) |
|
87 | ||
88 | return cmd.to_string() |
|
89 | ||
90 | def modify_note_command(self, note_id, text, kwargs): |
|
91 | """Generates xml string for modify note on gvmd.""" |