Skip to content

Commit

Permalink
Merge pull request #348 from saberlynx/nvt_preferences
Browse files Browse the repository at this point in the history
get_nvt command requests all details
  • Loading branch information
y0urself committed Nov 26, 2020
2 parents 4f3f3b2 + 330fbdb commit 8870ae1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
* get_nvt command requests all details [#348](https://github.com/greenbone/python-gvm/pull/348)
### Changed
* added the `audits` parameter to `get_policy` [#345](https://github.com/greenbone/python-gvm/pull/345)
### Deprecated
Expand Down
3 changes: 3 additions & 0 deletions gvm/protocols/gmpv7/gmpv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -3446,6 +3446,9 @@ def get_nvt(self, nvt_oid: str):

# for single entity always request all details
cmd.set_attribute("details", "1")
cmd.set_attribute("preferences", "1")
cmd.set_attribute("preference_count", "1")
cmd.set_attribute("timeout", "1")
return self._send_xml_command(cmd)

def get_nvt_families(self, *, sort_order: Optional[str] = None):
Expand Down
5 changes: 4 additions & 1 deletion tests/protocols/gmpv7/testcmds/test_get_nvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def test_get_nvt_with_nvt_oid(self):
self.gmp.get_nvt(nvt_oid='nvt_oid')

self.connection.send.has_been_called_with(
'<get_nvts nvt_oid="nvt_oid" details="1"/>'
(
'<get_nvts nvt_oid="nvt_oid" details="1" '
'preferences="1" preference_count="1" timeout="1"/>'
)
)

def test_get_nvt_missing_nvt_oid(self):
Expand Down

0 comments on commit 8870ae1

Please sign in to comment.