Skip to content

Commit

Permalink
Merge pull request #98 from wiegandm/modify_setting_value_base64
Browse files Browse the repository at this point in the history
Make sure `modify_setting` value is Base64-encoded
  • Loading branch information
bjoernricks authored Feb 25, 2019
2 parents 010a71c + 0e39dc6 commit 0a3c227
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
`get_preference`
* Fixed wrong order of key and value for condition_data, event_data and
method_data dict parameters of `modify_alert` method.
* Ensure `modify_setting` value is Base64-encoded

# python-gvm 1.0.0.beta2 (04.12.2018)

Expand Down
2 changes: 1 addition & 1 deletion gvm/protocols/gmpv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -4782,7 +4782,7 @@ def modify_setting(self, setting_id=None, name=None, value=None):
else:
cmd.add_element('name', name)

cmd.add_element('value', value)
cmd.add_element('value', _to_base64(value))

return self._send_xml_command(cmd)

Expand Down
4 changes: 2 additions & 2 deletions tests/protocols/gmpv7/test_modify_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_modify_setting(self):

self.connection.send.has_been_called_with(
'<modify_setting setting_id="s1">'
'<value>bar</value>'
'<value>YmFy</value>'
'</modify_setting>'
)

Expand All @@ -50,7 +50,7 @@ def test_modify_setting(self):
self.connection.send.has_been_called_with(
'<modify_setting>'
'<name>s1</name>'
'<value>bar</value>'
'<value>YmFy</value>'
'</modify_setting>'
)

Expand Down

0 comments on commit 0a3c227

Please sign in to comment.