My bad, adding the 2.10 commits: Merge branch 'stable-2.10' into stable-2.11
* stable-2.10 Fix specification of TIDiskParams Add unittests for instance modify parameter renaming Add renaming of instance custom params Add RAPI symmetry tests for groups Extend RAPI symmetry tests with RAPI-only aliases Add test for group custom parameter renaming Add renaming of group custom ndparams, ipolicy, diskparams Add the RAPI symmetry test for nodes Add aliases for nodes Allow choice of HTTP method for modification Add cluster RAPI symmetry test Fix failing cluster query test Add aliases for cluster parameters Add support for value aliases to RAPI Provide tests for GET/PUT symmetry Sort imports Also consider filter fields for deciding if using live data Document the python-fdsend dependency * stable-2.9 Fix failing gnt-node list-drbd command * stable-2.8 Add reason parameter to RAPI client functions Signed-off-by: Hrvoje Ribicic <[email protected]> Conflicts: lib/rapi/client.py: Add both params lib/rapi/rlib2.py: Remove reference to missing LU, add aliases src/Ganeti/Query/Query.hs: Take more imports On Thu, Mar 27, 2014 at 6:13 PM, Hrvoje Ribicic <[email protected]> wrote: > commit 0de2fa53a1e3d66c0456dd83b6927e1bb39db491 > Merge: df376ff 7bb2282 > Author: Hrvoje Ribicic <[email protected]> > Date: Thu Mar 27 17:09:50 2014 +0000 > > Merge branch 'stable-2.10' into stable-2.11 > > * stable-2.9 > Fix failing gnt-node list-drbd command > > * stable-2.8 > Add reason parameter to RAPI client functions > > Signed-off-by: Hrvoje Ribicic <[email protected]> > > Conflicts: > lib/rapi/client.py: Add both params > lib/rapi/rlib2.py: Remove reference to missing LU, add aliases > src/Ganeti/Query/Query.hs: Take more imports > > diff --cc lib/rapi/client.py > index 174f171,4b4969d..250f4f7 > --- a/lib/rapi/client.py > +++ b/lib/rapi/client.py > @@@ -1179,9 -1276,8 +1276,8 @@@ class GanetiRapiClient(object): # pylin > (GANETI_RAPI_VERSION, instance)), query, > None) > > def ExportInstance(self, instance, mode, destination, shutdown=None, > -- remove_instance=None, > - x509_key_name=None, destination_x509_ca=None, > - compress=None): > - x509_key_name=None, destination_x509_ca=None, > reason=None): > ++ remove_instance=None, x509_key_name=None, > ++ destination_x509_ca=None, compress=None, > reason=None): > """Exports an instance. > > @type instance: string > @@@ -1203,14 -1301,16 +1301,17 @@@ > _SetItemIf(body, x509_key_name is not None, "x509_key_name", > x509_key_name) > _SetItemIf(body, destination_x509_ca is not None, > "destination_x509_ca", destination_x509_ca) > + _SetItemIf(body, compress is not None, "compress", compress) > > + query = [] > + _AppendReason(query, reason) > + > return self._SendRequest(HTTP_PUT, > ("/%s/instances/%s/export" % > - (GANETI_RAPI_VERSION, instance)), None, > body) > + (GANETI_RAPI_VERSION, instance)), query, > body) > > def MigrateInstance(self, instance, mode=None, cleanup=None, > - target_node=None): > + target_node=None, reason=None): > """Migrates an instance. > > @type instance: string > diff --cc lib/rapi/rlib2.py > index b9828fb,2e92c05..df90620 > --- a/lib/rapi/rlib2.py > +++ b/lib/rapi/rlib2.py > @@@ -413,6 -418,10 +417,9 @@@ class R_2_nodes_name(baserlib.OpcodeRes > """/2/nodes/[node_name] resource. > > """ > - GET_OPCODE = opcodes.OpNodeQuery > + GET_ALIASES = { > + "sip": "secondary_ip", > + } > > def GET(self): > """Send information about a node. > diff --cc qa/qa_node.py > index 58c281c,42d13d6..3d02548 > --- a/qa/qa_node.py > +++ b/qa/qa_node.py > @@@ -32,10 -32,10 +32,10 @@@ import qa_confi > import qa_error > import qa_utils > > - from qa_utils import AssertCommand, AssertEqual > + from qa_utils import AssertCommand, AssertEqual, AssertIn, > GetCommandOutput > > > -def _NodeAdd(node, readd=False): > +def NodeAdd(node, readd=False, group=None): > if not readd and node.added: > raise qa_error.Error("Node %s already in cluster" % node.primary) > elif readd and not node.added: > diff --cc qa/qa_rapi.py > index 5e6904c,7ce41c1..cfbf3ff > --- a/qa/qa_rapi.py > +++ b/qa/qa_rapi.py > @@@ -23,24 -23,24 +23,25 @@@ > > """ > > - import tempfile > + import functools > + import itertools > import random > import re > - import itertools > - import functools > + import tempfile > > - from ganeti import utils > + from ganeti import cli > + from ganeti import compat > from ganeti import constants > from ganeti import errors > - from ganeti import cli > - from ganeti import rapi > + from ganeti import pathutils > from ganeti import objects > + from ganeti import opcodes > from ganeti import query > - from ganeti import compat > from ganeti import qlang > - from ganeti import pathutils > + from ganeti import rapi > + from ganeti import utils > > +from ganeti.http.auth import ParsePasswordFile > import ganeti.rapi.client # pylint: disable=W0611 > import ganeti.rapi.client_utils > > diff --cc test/py/ganeti.rapi.rlib2_unittest.py > index 1b760c8,ba0ac62..eee87e4 > --- a/test/py/ganeti.rapi.rlib2_unittest.py > +++ b/test/py/ganeti.rapi.rlib2_unittest.py > @@@ -1584,10 -1620,44 +1620,44 @@@ class TestGroupModify(unittest.TestCase > > self.assertTrue(isinstance(op, opcodes.OpGroupSetParams)) > self.assertEqual(op.group_name, name) > - self.assertFalse(hasattr(op, "alloc_policy")) > - self.assertFalse(hasattr(op, "dry_run")) > + self.assertTrue(op.alloc_policy is None) > + self.assertFalse(op.dry_run) > self.assertRaises(IndexError, cl.GetNextSubmittedJob) > > + def testCustomParamRename(self): > + clfactory = _FakeClientFactory(_FakeClient) > + > + name = "groupie" > + data = { > + "custom_diskparams": {}, > + "custom_ipolicy": {}, > + "custom_ndparams": {}, > + } > + > + handler = _CreateHandler(rlib2.R_2_groups_name_modify, [name], {}, > data, > + clfactory) > + job_id = handler.PUT() > + > + cl = clfactory.GetNextClient() > + self.assertRaises(IndexError, clfactory.GetNextClient) > + > + (exp_job_id, (op, )) = cl.GetNextSubmittedJob() > + self.assertEqual(job_id, exp_job_id) > + > + self.assertTrue(isinstance(op, opcodes.OpGroupSetParams)) > + self.assertEqual(op.diskparams, {}) > + self.assertEqual(op.ipolicy, {}) > + self.assertEqual(op.ndparams, {}) > + > + self.assertRaises(IndexError, cl.GetNextSubmittedJob) > + > + # Define both > + data["diskparams"] = {} > + assert "diskparams" in data and "custom_diskparams" in data > + handler = _CreateHandler(rlib2.R_2_groups_name_modify, [name], {}, > data, > + clfactory) > + self.assertRaises(http.HttpBadRequest, handler.PUT) > + > > class TestGroupAdd(unittest.TestCase): > def test(self): >
