Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gvm/protocols/gmp/requests/next/_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def modify_agents(
function=cls.modify_agents.__name__, argument="agent_ids"
)

cmd = XmlCommand("modify_agents")
cmd = XmlCommand("modify_agent")
xml_agents = cmd.add_element("agents")

for agent_id in agent_ids:
Expand Down Expand Up @@ -256,7 +256,7 @@ def delete_agents(cls, agent_ids: list[EntityID]) -> Request:
function=cls.delete_agents.__name__, argument="agent_ids"
)

cmd = XmlCommand("delete_agents")
cmd = XmlCommand("delete_agent")
xml_agents = cmd.add_element("agents")

for agent_id in agent_ids:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def test_delete_agents(self):
self.gmp.delete_agents(agent_ids=["agent-123", "agent-456"])

self.connection.send.has_been_called_with(
b"<delete_agents>"
b"<delete_agent>"
b'<agents><agent id="agent-123"/><agent id="agent-456"/></agents>'
b"</delete_agents>"
b"</delete_agent>"
)

def test_delete_agents_without_ids(self):
Expand Down
12 changes: 6 additions & 6 deletions tests/protocols/gmpnext/entities/agents/test_modify_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def test_modify_agents_basic(self):
self.gmp.modify_agents(agent_ids=["agent-123"])

self.connection.send.has_been_called_with(
b"<modify_agents>"
b"<modify_agent>"
b'<agents><agent id="agent-123"/></agents>'
b"</modify_agents>"
b"</modify_agent>"
)

def test_modify_agents_with_authorized_only(self):
Expand All @@ -21,10 +21,10 @@ def test_modify_agents_with_authorized_only(self):
)

self.connection.send.has_been_called_with(
b"<modify_agents>"
b"<modify_agent>"
b'<agents><agent id="agent-123"/><agent id="agent-456"/></agents>'
b"<authorized>1</authorized>"
b"</modify_agents>"
b"</modify_agent>"
)

def test_modify_agents_with_full_config_and_comment(self):
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_modify_agents_with_full_config_and_comment(self):
)

self.connection.send.has_been_called_with(
b"<modify_agents>"
b"<modify_agent>"
b'<agents><agent id="agent-123"/><agent id="agent-456"/></agents>'
b"<authorized>1</authorized>"
b"<config>"
Expand All @@ -78,7 +78,7 @@ def test_modify_agents_with_full_config_and_comment(self):
b"</heartbeat>"
b"</config>"
b"<comment>Updated agents</comment>"
b"</modify_agents>"
b"</modify_agent>"
)

def test_modify_agents_with_full_config_with_missing_element(self):
Expand Down