Commit 8ae4d0de authored by Michele Tartara's avatar Michele Tartara

Add reason parameter to RAPI client functions

Only the functions for starting, stopping and rebooting a VM had a reason
parameter. Now, all the RAPI client functions generating opcodes do.

Also, one test is expanded to verify that a RAPI request with both body and
query supports the reason parameter properly.

Fixes Issue 776.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 7d76de75
This diff is collapsed.
......@@ -1271,13 +1271,15 @@ class GanetiRapiClientTests(testutils.GanetiTestCase):
for mnh in [None, False, True]:
self.rapi.AddResponse("14470")
self.assertEqual(14470,
self.client.ModifyCluster(maintain_node_health=mnh))
self.client.ModifyCluster(maintain_node_health=mnh,
reason="PinkBunniesInvasion"))
self.assertHandler(rlib2.R_2_cluster_modify)
self.assertItems([])
data = serializer.LoadJson(self.rapi.GetLastRequestData())
self.assertEqual(len(data), 1)
self.assertEqual(data["maintain_node_health"], mnh)
self.assertEqual(self.rapi.CountPending(), 0)
self.assertQuery("reason", ["PinkBunniesInvasion"])
def testRedistributeConfig(self):
self.rapi.AddResponse("3364")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment