On Fri, Jan 21, 2011 at 4:24 PM, Iustin Pop <[email protected]> wrote:
> This is the merge of devel-2.4 into master, and then I'll ff devel-2.4
> to master:
>
> commit ee40ea2b66ab34279356595c23865d8e19fe0461
> Merge: cfb084a 075b62c
> Author: Iustin Pop <[email protected]>
> Date:   Fri Jan 21 16:22:18 2011 +0100
>
>    Merge branch 'devel-2.4'
>
>    * devel-2.4:
>      Another fix for LUClusterVerifyDisks
>      QA: also run gnt-cluster verify-disks
>      Fix disk adoption breakage
>      Fix typo in query2 design document
>      Improve documentation for QRFS_UNAVAIL
>      lvmstrap: add PV-on-partition support
>      lvmstrap: abstract a little the sysfs paths
>      lvmstrap: ignore small-sized partitions
>      lvmstrap: add explicit test for swap backends
>      lvmstrap: add an explicit test for mounted devices
>      lvmstrap: add more excluded FS types
>      lvmstrap: fix very old contact information
>      Instance query: replace duplicates with aliases
>      query: Add alias support in _PrepareFieldList
>      Fix disk count check in LUSetInstanceParams
>      Document iallocator change (alloc_policy)
>
>    Conflicts:
>            lib/constants.py (due to QRFS→RS on master and doc on 2.4)
>
> diff --cc lib/constants.py
> index c6adfb4,450ae79..df51ef3
> --- a/lib/constants.py
> +++ b/lib/constants.py
> @@@ -1000,22 -1000,24 +1000,24 @@@ QFT_ALL = frozenset(
>  # Query result field status (don't change or reuse values as they're used by
>  # clients)
>  #: Normal field status
>  -QRFS_NORMAL = 0
>  +RS_NORMAL = 0
>  #: Unknown field
>  -QRFS_UNKNOWN = 1
>  -#: No data (e.g. RPC error), can be used instead of L{QRFS_OFFLINE}
>  -QRFS_NODATA = 2
>  +RS_UNKNOWN = 1
>  +#: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
>  +RS_NODATA = 2
> - #: Value unavailable for item
> + #: Value unavailable/unsupported for item; if this field is supported
>  -#: but we cannot get the data for the moment, QRFS_NODATA or
>  -#: QRFS_OFFLINE should be used
>  -QRFS_UNAVAIL = 3
> ++#: but we cannot get the data for the moment, RS_NODATA or
> ++#: RS_OFFLINE should be used
>  +RS_UNAVAIL = 3
>  #: Resource marked offline
>  -QRFS_OFFLINE = 4
>  -
>  -QRFS_ALL = frozenset([
>  -  QRFS_NORMAL,
>  -  QRFS_UNKNOWN,
>  -  QRFS_NODATA,
>  -  QRFS_UNAVAIL,
>  -  QRFS_OFFLINE,
>  +RS_OFFLINE = 4
>  +
>  +RS_ALL = frozenset([
>  +  RS_NORMAL,
>  +  RS_UNKNOWN,
>  +  RS_NODATA,
>  +  RS_UNAVAIL,
>  +  RS_OFFLINE,
>    ])
>
>  # max dynamic devices
> diff --cc test/ganeti.query_unittest.py
> index a58a81a,0472380..024ff77
> --- a/test/ganeti.query_unittest.py
> +++ b/test/ganeti.query_unittest.py
> @@@ -247,13 -247,32 +247,32 @@@ class TestQuery(unittest.TestCase)
>      q = query.Query(fielddef, ["name", "other0", "nodata", "unavail", "unk"])
>      self.assertEqual(len(q._fields), 5)
>      self.assertEqual(q.Query(_QueryData(range(1, 10))),
>  -                     [[(constants.QRFS_NORMAL, "name%s" % i),
>  -                       (constants.QRFS_NORMAL, 1234),
>  -                       (constants.QRFS_NODATA, None),
>  -                       (constants.QRFS_UNAVAIL, None),
>  -                       (constants.QRFS_UNKNOWN, None)]
>  +                     [[(constants.RS_NORMAL, "name%s" % i),
>  +                       (constants.RS_NORMAL, 1234),
>  +                       (constants.RS_NODATA, None),
>  +                       (constants.RS_UNAVAIL, None),
>  +                       (constants.RS_UNKNOWN, None)]
>                        for i in range(1, 10)])
>
> +   def testAliases(self):
> +     fields = [
> +       (query._MakeField("a", "a-title", constants.QFT_TEXT), None,
> +        lambda *args: None),
> +       (query._MakeField("b", "b-title", constants.QFT_TEXT), None,
> +        lambda *args: None),
> +       ]
> +     # duplicate field
> +     self.assertRaises(AssertionError, query._PrepareFieldList, fields,
> +                       [("b", "a")])
> +     self.assertRaises(AssertionError, query._PrepareFieldList, fields,
> +                       [("c", "b"), ("c", "a")])
> +     # missing target
> +     self.assertRaises(AssertionError, query._PrepareFieldList, fields,
> +                       [("c", "d")])
> +     fdefs = query._PrepareFieldList(fields, [("c", "b")])
> +     self.assertEqual(len(fdefs), 3)
> +     self.assertEqual(fdefs["b"][1:], fdefs["c"][1:])
> +
>
>  class TestGetNodeRole(unittest.TestCase):
>    def testMaster(self):
>

LGTM, thanks!

René

Reply via email to