From 330fbdbb6dbb94000e652dab89a7de69c315a5c7 Mon Sep 17 00:00:00 2001 From: Crystal Lai Date: Thu, 26 Nov 2020 10:39:52 +0100 Subject: [PATCH] Add other options too --- CHANGELOG.md | 2 +- gvm/protocols/gmpv7/gmpv7.py | 2 ++ tests/protocols/gmpv7/testcmds/test_get_nvt.py | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 839600b40..334e97414 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -* get_nvt command requests preferences [#348](https://github.com/greenbone/python-gvm/pull/348) +* 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 diff --git a/gvm/protocols/gmpv7/gmpv7.py b/gvm/protocols/gmpv7/gmpv7.py index 5eabd5da2..24eb37b10 100644 --- a/gvm/protocols/gmpv7/gmpv7.py +++ b/gvm/protocols/gmpv7/gmpv7.py @@ -3447,6 +3447,8 @@ 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): diff --git a/tests/protocols/gmpv7/testcmds/test_get_nvt.py b/tests/protocols/gmpv7/testcmds/test_get_nvt.py index 709130876..dac395590 100644 --- a/tests/protocols/gmpv7/testcmds/test_get_nvt.py +++ b/tests/protocols/gmpv7/testcmds/test_get_nvt.py @@ -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( - '' + ( + '' + ) ) def test_get_nvt_missing_nvt_oid(self):