History | View | Annotate | Download (38.6 kB)
merge upstream devel-2.4
Conflicts: lib/cli.py lib/cmdlib.py lib/config.py lib/opcodes.py
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
ht: Add new check for numbers
Places which receive floats can usually also deal with integers, e.g.OpTestDelay. Tests are added and the new check function is used for theaforementioned opcode and verifying query results.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
query: add network query primitives
Add NetworkQueryData data container for network-related queries. Also add anetwork query field generator and helper functions to generate usage statisticsfor IP address pools.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
gnt-network info: include external reservations
Also include the list of externally reserved IP addresses in an address pool inthe output of gnt-network info <network_name>.
Fix title of query field containing instance name
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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>
Instance query: replace duplicates with aliases
query: use the actual types for BE/HV parameters
This patch exposes the VTYPE kind of BE/HV parameters, instead ofreturning QFT_OTHER. The current situation makes a query like:
gnt-instance list -o name,be/memory,oper_ram
very strange looking.
Signed-off-by: Iustin Pop <iustin@google.com>...
query: return UNAVAIL for "wrong" HV parameters
If a HV parameter is required that does not apply for an instance,currently the code returns None. This is bad, as it means we cannotswitch to the actual HV parameter types and validate correctly thisfield....
query: change (debug-mode) field validation errors
Currently, the single assert just checks that the entire row isconsistent (true/false), and dumps the row and field definitions as anaccompanying message. This makes it very hard to understand what failed....
Rename a few instance field titles
The conversion to querylib introduced unique field titles, which howeverdid an inconsistent rename of the instance vcpus/memory fields.
This patch makes both BE_MEMORY and VCPUS be named with prefix “Config”(which before was “Configured”), and drops the “Runtime” (note no...
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....
Import QRFS_* and QFT_* in query.py
Currently, the QRFT/QFT constants are used with the module (e.g.constants.QRFS_NORMAL) in the query library. Given that there are 176uses of these constants in a module that has roughly ~1200 lines intotal (including whitespace), it makes sense to import these directly to...
query: Update docstrings
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
List node parameters in gnt-group list
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
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.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
query.py: add definitions for node 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.
Convert “gnt-debug locks” to query2
Locks can now be queried using “Query(what="lock", …)” over LUXI.
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...
query: Add wrapper for creating response object
It'll be used for querying locks.
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
query: Improve error checking
- Show only field definition, not callback when a result row is inconsistent- Show list of duplicate titles if there are any (module load time)
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
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.