History | View | Annotate | Download (64.9 kB)
Group query now calculates ipolicy
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
unittests: use max/min memory
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Introduce admin_state as 3-values data type
Rename admin_up to admin_state
query: Use new SequenceToDict utility
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename filter and filter_ to qfilter
We currently use 'filter' as the OpCode, QueryRequest and RAPI fieldname for representing a query filter. However, since 'filter' is abuilt-in function, we actually have to use filter_ throughout the codein order to not override the built-in function....
Add primary/second nodes' group as query fields
These will be very useful for ganeti-watcher as it needs to retrieveinstances by group.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add instance query field for OS parameters
These were not available as a query field before. Update unittestsand description text for the other “..params” fields.
query: Add implementation of regex match operator
So far this operator was not implemented. This patch adds an additionalvalue preparation function to the function table for binary operators,used to compile the regular expression. Unittests are included....
Convert OsDiagnose to query
query: Add operator for truth
The “?” operator is the equivalent of “if var” in Python.
query: Fix bug when names are specified
If the client/caller would specify names through the use of a filter,the result would be sorted. This is a regression over earlier Ganetiversions and verified in QA. This patch adds an optional parameter tocontrol the sorting and provides unittests....
query: Add support for filters
This patch adds a “compiler” for query filters, converting them to acallable function used while preparing the query result. In addition, ahints call allows some analysis to be done on the query (e.g. referencednames), making data collection more efficient....
Add query field flags
Some fields (e.g. “name”) should be treated specially when comparing forequality. Hypervisor names should use normal rules, but for node names,“node2” should be equivalent with “node2.example.com”.
To make these differences, a new field for flags is added to the query...
Query: Add additional test to node.powered for OOB handling
This patch covers the testing of _GetNodePower of query.py not only forunavailable but also for OOB support and returning the rightnode.powered.
Signed-off-by: René Nussbaumer <rn@google.com>...
Add query field descriptions
- Make “doc” parameter to MakeField non-optional- Add descriptions for all fields
Add constants for node roles
Add constants for instance status
They've been hardcoded for too long.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Merge remote branch 'devel-2.4'
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
query_unittest: Fix argument to set()
Commit e431074f introduced an uncatched bug. This patch fixes this. Theset is expecting a list or iteratable to work on, so it splitted theprovided instance name into a set of characters. This caused theexp_status never been set and therefore not catched in one assert rule...
query: Use aliases for legacy instance NIC fields
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
Since we don't have the data per design, UNAVAIL is appropriate here,while NODATA is not.
The patch also adds a comment: if we extend the live fields list tocontain other data in the future, we need to reevaluate this solution....
Export console information as query field
This makes it possible to get the console information via a LUXI query.
Fix instance list for instances running multiple times
If for some reason (e.g. failed migration) one instance is runningon multiple nodes the output can become inconsistent. To get that errorand make it consistent between runs we make the call on the secondary...
Merge branch 'devel-2.4'
Rename QRFS_* to RS_*
This patch renames QRFS_* to RS_* fields so they can be used in otherplaces (i.e. LUs) without confusion, as this was initially meant forquery operations.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
query: Add alias support in _PrepareFieldList
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
query: Change internal result computation
While looking at the query library, I realized that while we have fivefield statuses, making this a 5-dimensional space, four of them areshrunk to a single possible value (None). Hence it should be possible toconvert this into a single value space plus extra 4 special constants....
List node parameters (if any) in gnt-node info
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Support query of node field 'powered'
This field is based on OOB support and is only available if there's oobsupport for that node.
ganeti.query_unittest.py: add tests for group queries
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
ganeti.query_unittest.py: test lock fields too
Additionally, change TestQueryFields.testSomeFields() to handle lists offields shorter than 20 elements.
query2: Add new field status “offline”
This allows “gnt-node list” to show the difference between modes markedoffline and nodes with e.g. RPC errors (“(nodata)”). node1 is themaster, node2's node daemon crashed and node3 is marked offline:
$ gnt-node list -o name,offline,dtotal,dfree...
Move QueryFields to query module
Also replace “sorted” with “utils.NiceSort” now that it supports a keyfunction.
query: Handle items missing timestamps
In upgraded configurations, some items might miss the “ctime” and/or“mtime” values and need to be handled specially.
query: Add definition for instance queries
Add node query definition
This includes a bunch of helper functions which can be helpful for otherqueries, too. Unittests are included.
Add utility class for definition-based data queries
While not immediately visible, using definition-based queries will allowfor a number of optimizations and simplifications. This patch justcontains the utility class used for executing queries.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...